How is it possible with the call of $this-> Cell (‘cellnamefile’, [‘name’],[‘config’ => ‘xyz’, ‘label’ => ‘formlable’]) options or arguments for the config, to be given to display() ?
https://api.cakephp.org/5.1/trait-Cake.View.CellTrait.html#cell()
Additional arguments for cell method. e.g.: cell('TagCloud::smallList', ['a1' => 'v1', 'a2' => 'v2']) maps to View\Cell\TagCloud::smallList(v1, v2)
perfect! but only that works without error:
<?= $this->cell('SelectListFiscalYear', [null, ['label' => 'fiscal year']]) ?>
that not:
<?= $this->cell('SelectListFiscalYear', ['label' => 'fiscal year']]) ?>
and that not:
<?= $this->cell('SelectListFiscalYear', null | 'name', ['label' => 'fiscal year']]) ?>
thx Kevin
[null, ['label' => 'fiscal year']]
is an array of two arguments, the first is null
, the second is an array with a single key of “label” with the value “fiscal year”. If your cell function is expecting two arguments, the first of which can be null
and the second is an array, then that’s why this works.
['label' => 'fiscal year']
is an array of a single argument, being the string “fiscal year”. If your cell function is expecting two arguments, then that’s why this doesn’t work.
null | 'name', ['label' => 'fiscal year']
is not passing an array for the first argument, so that’s why that doesn’t work.
1 Like