Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update examples using the deprecated config #7972

Merged
merged 1 commit into from
Dec 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading