To force all elements to have a default class attribute value of "foo",
simply do the following:
$this->form->config(array('label' => array('class' => 'foo')));
Note that this can be overridden on a case-by-case basis, and when overriding, values are
not merged or combined. Therefore, if you wanted a particular to have both foo
and bar as classes, you would have to specify 'class' => 'foo bar'.
You can also use this method to change the string template that a method uses to render its
content. For example, the default template for rendering a checkbox is
''. However, suppose you implemented your
own custom UI elements, and you wanted to change the markup used, you could do the following:
$this->form->config(array('templates' => array(
'checkbox' => ''
)));
Now, for any calls to $this->form->checkbox(), your custom markup template will be applied.
This works for any Form method that renders HTML elements.
See also:
lithium\template\helper\Form::$_templateMap
An associative array where the keys are `Form` method names (or
`'templates'`, to include a template-overriding sub-array), and the
values are arrays of configuration options to be included in the `$options`
parameter of each method specified.
Returns an array containing the currently set per-method configurations, and
an array of the currently set template overrides (in the `'templates'` array key).