Skip to content

Commit

Permalink
Allow setting CrudViewHelper config through app config
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Sep 8, 2024
1 parent 73629d6 commit 7250135
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/defaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@
'tablesBlacklist' => [
'phinxlog',
],
'helperConfig' => [],
],
];
6 changes: 6 additions & 0 deletions src/View/Helper/CrudViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use BackedEnum;
use Cake\Chronos\ChronosDate;
use Cake\Chronos\ChronosTime;
use Cake\Core\Configure;
use Cake\Core\Exception\CakeException;
use Cake\Database\Type\EnumLabelInterface;
use Cake\Datasource\EntityInterface;
Expand Down Expand Up @@ -53,6 +54,11 @@ class CrudViewHelper extends Helper
'timeFormat' => null,
];

public function initialize(array $config): void

Check failure on line 57 in src/View/Helper/CrudViewHelper.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

Missing doc comment for function initialize()
{
$this->setConfig(Configure::read('CrudView.helperConfig', []));
}

/**
* Set context
*
Expand Down

0 comments on commit 7250135

Please sign in to comment.