Skip to content

Commit

Permalink
Merge pull request #7972 from cakephp/ADmad-patch-1
Browse files Browse the repository at this point in the history
Update examples using the deprecated config
  • Loading branch information
markstory authored Dec 15, 2024
2 parents 046bea2 + a67e818 commit e6b8022
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions en/views/helpers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ your helper requires. For example::
* @var array<string, mixed>
*/
protected array $_defaultConfig = [
'errorClass' => 'error',
'templates' => [
'label' => '<label for="{{for}}">{{content}}</label>',
],
Expand All @@ -134,8 +133,8 @@ Any configuration provided to your helper's constructor will be merged with the
default values during construction and the merged data will be set to
``_config``. You can use the ``getConfig()`` method to read runtime configuration::

// Read the errorClass config option.
$class = $this->Awesome->getConfig('errorClass');
// Read the autoSetCustomValidity config option.
$class = $this->Awesome->getConfig('autoSetCustomValidity');

Using helper configuration allows you to declaratively configure your helpers and
keep configuration logic out of your controller actions. If you have
Expand Down

0 comments on commit e6b8022

Please sign in to comment.