wiki:rfc/jforms-controls-plugins is not used any more and exists only for history. Post new tickets on the Github account. n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Version 3 (modified by laurentj, 9 years ago) (diff)


Plugins for jforms controls

jForms, in the builder part, should have a plugin system to provide plugin which generate the HTML for a control.

plugin implementation

A plugin could be a class inheriting from this kind of class :

class jFormsWidgetBuilder {
   // here some common things to any controls for any builder


// Perhaps do an interface ?
class jFormsHtmlWidgetBuilder extends jFormsWidgetBuilder  {
   // here common things to any controls for the HTML builder
   protected function getClass();
   protected function getId();
   protected function getCommonJS();
   // etc..

    // here (abstract or not) methods called by the builder

   function outputLabel() { }

   function outputControl() { }

   function outputHelp() {}

   function outputJs() {}

class mypluginHtmlWidgetBuilder extends jFormsHtmlWidgetBuilder {
   // redefined methods and more



To indicate plugins we want to use.

For any forms and specific builder, we can indicate it in defaultconfig.ini.php

; controltype = pluginname = myplugin1
htmleditor = myplugin2
textarea = myplugin3

To indicate a plugin in the template, for a specific form, we list the plugins in the array of options for the builder

{form $form,'submit_action', $actionparams, 'html',
        array('plugins'=> array(