Quick links: Content - sections - sub sections
EN FR

Trace: crud-jform-dao responsetcpdf tutors coord crud main-concepts responsetcpdf coord xml-1.1 jforms

Wiki: Sitemap - Recent changes - Back link

As noted in display jforms chapter, you can select which plugin will generate forms content (in HTML, XUL, javascript and so on..) sent to clients.

Thoses plugins are called generators. You can of course create one and for any format. Pick a name, say “moreforms”. Then :

  • Create a moreforms directory in a jforms plugins repository.
  • Create a moreforms.jformsbuilder.php
  • In it, declare a moreformsJformsBuilder class inheriting from jFormsBuilderBase

moreformsJformsBuilder should implement following list of methods. Those display form parts and don't return any value. They are called through jForms template plugins.

After each modification of your generator, don't forget to clear your temp directory (by using the command cleartemp with the jelix script).

outputMetaContent

Use the controller response object to specify CSS stylesheets, javascript files to be included in the final response. Example :

   public function outputMetaContent($t) {
        global $gJCoord, $gJConfig;
        $resp= $gJCoord->response;
        if($resp === null){
            return;
        }
        // if files are located in jelix folder
        $www = $gJConfig->urlengine['jelixWWWPath'];
        // or in your app www folder        
        $www = $gJConfig->urlengine['basePath'];
 
        $resp->addJSLink($www.'js/file.js');
        $resp->addCSSLink($www.'design/file.css');
   }

This method is the first called.

outputHeader

This one generates tags declaring your form and other useful form contents. OutputHeader opens a <form> tag, optionally displays error messages, generates hidden fields and adds some javascript.

outputFooter

This is the last method called by template plugins. As for HTML, outputFooter closes the form tags </form> and adds some javascript.

outputAllControls()

This one is called by formfull template plugin. It has to generate all controls (apart of those generated by outputHeader and outputFooter).

outputControlLabel

Called in {form} template block for fields labels, it generates labels tags.

As argument, it receives a jFormsControl object defining the control associated.

outputControl

Called in {form} template block for controls, it generates control tags.

As argument, it receives a jFormsControl object defining the control associated.

en/manual-1.1/plugins/jforms.txt · Last modified: 2010/04/23 09:06 by laurent
Recent changes RSS feed Creative Commons License