templating inside a generated form helps creating complex form layouts


An element type to reorganize your form layout.

It's a template (or a container) for displaying any other form elements grouped together. A great way to

  • group together title - first name - lastname fields in one form row (by removing table tags from the rowlayout of these elements and display them in a template)
  • build special layouts like this:

As this element only affects form layout, there's no returned value by $clonefish->getElementValues() or other getter methods.

$config = Array(
  'id' => Array(
    'type'           => 'template',
    'value'          => 
      '<table>' .
      '%newslettercheckbox%' . 
      '%confirmcheckbox%' . 
      '%marketingcheckbox%' . 
      '</table>' .

// This setting assumes that the elements called 
// newslettercheckbox,
// confirmcheckbox,
// marketingcheckbox are already defined, 
// and they have inherited the form 'element' layout setting 
// of a tabular form layout, which is a table row.


Live examples:

form validation for developers!

clonefish is a proven, mature form generator class that helps PHP developers to create, validate and process secure, flexible and easy-to-maintain forms
learn more
Bookmark and Share