Skip to content
Permalink
Browse files

Add the `$idPrefix` config option to FormHelper

closes #6134
  • Loading branch information...
jadb committed Mar 23, 2015
1 parent ee53820 commit 2ccd83ae62255bce88e76d52eeae7df5865e49a3
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/View/Helper/FormHelper.php
@@ -80,6 +80,7 @@ class FormHelper extends Helper
* @var array
*/
protected $_defaultConfig = [
'idPrefix' => null,
'errorClass' => 'form-error',
'typeMap' => [
'string' => 'text', 'datetime' => 'datetime', 'boolean' => 'checkbox',
@@ -227,6 +228,7 @@ public function __construct(View $View, array $config = [])
$this->widgetRegistry($registry, $widgets);
$this->_addDefaultContextProviders();
$this->_idPrefix = $this->config('idPrefix');
}
/**
@@ -352,7 +354,9 @@ public function create($model = null, array $options = [])
'idPrefix' => null,
];
$this->_idPrefix = $options['idPrefix'];
if (!is_null($options['idPrefix'])) {
$this->_idPrefix = $options['idPrefix'];
}
$templater = $this->templater();
if (!empty($options['templates'])) {
@@ -520,7 +524,7 @@ public function end(array $secureAttributes = [])
$templater->pop();
$this->requestType = null;
$this->_context = null;
$this->_idPrefix = null;
$this->_idPrefix = $this->config('idPrefix');
return $out;
}

0 comments on commit 2ccd83a

Please sign in to comment.
You can’t perform that action at this time.