/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/View/Widget
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/View/Widget/TextareaWidget.php (2412B)
*/
protected $defaults = [
'val' => '',
'name' => '',
'escape' => true,
'rows' => 5,
'templateVars' => [],
];
/**
* Render a text area form widget.
*
* Data supports the following keys:
*
* - `name` - Set the input name.
* - `val` - A string of the option to mark as selected.
* - `escape` - Set to false to disable HTML escaping.
*
* All other keys will be converted into HTML attributes.
*
* @param array
$data The data to build a textarea with.
* @param \Cake\View\Form\ContextInterface $context The current form context.
* @return string HTML elements.
*/
public function render(array $data, ContextInterface $context): string
{
$data += $this->mergeDefaults($data, $context);
if (
!array_key_exists('maxlength', $data)
&& isset($data['fieldName'])
) {
$data = $this->setMaxLength($data, $context, $data['fieldName']);
}
return $this->_templates->format('textarea', [
'name' => $data['name'],
'value' => $data['escape'] ? h($data['val']) : $data['val'],
'templateVars' => $data['templateVars'],
'attrs' => $this->_templates->formatAttributes(
$data,
['name', 'val']
),
]);
}
}