Provides cell() method for usage in Controller and View classes.
_createCell( string $className , string $action , string $plugin , array $options )
Create and configure the cell instance.
$className
$action
$plugin
$options
Cake\View\Cell
cell( string $cell , array $data [] , array $options [] )
Renders the given cell.
Example:
// Taxonomy\View\Cell\TagCloudCell::smallList() $cell = $this->cell('Taxonomy.TagCloud::smallList', ['limit' => 10]); // App\View\Cell\TagCloudCell::smallList() $cell = $this->cell('TagCloud::smallList', ['limit' => 10]);
The display
action will be used by default when no action is provided:
// Taxonomy\View\Cell\TagCloudCell::display() $cell = $this->cell('Taxonomy.TagCloud');
Cells are not rendered until they are echoed.
$cell
You must indicate cell name, and optionally a cell action. e.g.: TagCloud::smallList
will invoke View\Cell\TagCloudCell::smallList()
, display
action will be invoked by default when none is provided.
$data
optional [] Additional arguments for cell method. e.g.: cell('TagCloud::smallList', ['a1' => 'v1', 'a2' => 'v2'])
maps to View\Cell\TagCloud::smallList(v1, v2)
$options
optional [] Cake\View\Cell
Cake\View\Exception\MissingCellException
© 2005–2017 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/3.4/class-Cake.View.CellTrait.html