lithium\template\helper\Form::__call()
Implements alternative input types as method calls against Form
helper. Enables the
generation of HTML5 input types and other custom input types:
Parameters
-
string
$type
The method called, which represents the
type
attribute of the<input />
tag. -
array
$params
An array of method parameters passed to the method call. The first element should be the name of the input field, and the second should be an array of element attributes.
Returns
stringReturns an <input />
tag of the type specified in $type
.
Source
public function __call($type, array $params = []) {
$params += [null, []];
list($name, $options) = $params;
list($name, $options, $template) = $this->_defaults($type, $name, $options);
$template = $this->_context->strings($template) ? $template : 'input';
return $this->_render($type, $template, compact('type', 'name', 'options'));
}