lithium\template\helper\Form::config PHP Method

config() public method

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
public config ( array $config = [] ) : array
$config array 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.
return array Returns an array containing the currently set per-method configurations, and an array of the currently set template overrides (in the `'templates'` array key).
    public function config(array $config = array())
    {
        if (!$config) {
            $keys = array('base' => '', 'text' => '', 'textarea' => '', 'attributes' => '');
            return array('templates' => $this->_templateMap) + array_intersect_key($this->_config, $keys);
        }
        if (isset($config['templates'])) {
            $this->_templateMap = $config['templates'] + $this->_templateMap;
            unset($config['templates']);
        }
        return ($this->_config = Set::merge($this->_config, $config)) + array('templates' => $this->_templateMap);
    }