Cell base.
$View
public Instance of the View created during rendering. Won't be set until after Cell::__toString() is called.
$_cache
protected array|boolean
$_validCellOptions
protected array
List of valid options (constructor's fourth arguments) Override this property in subclasses to whitelist which options you want set as properties in your Cell.
$_validViewOptions
protected array
$action
public string
$args
public array
$helpers
public array
$plugin
public string
$request
public An instance of a Cake\Network\Request object that contains information about the current request. This object contains all the information about a request and several methods for reading additional information about the request.
$response
public Cake\Network\Response
$template
public string
Name of the template that will be rendered. This property is inflected from the action name that was invoked.
_eventClass
, _eventManager
_tableLocator
_modelFactories
, _modelType
, modelClass
_viewBuilder
, viewClass
, viewVars
__construct( Cake\Http\ServerRequest $request null , Cake\Network\Response $response null , Cake\Event\EventManager $eventManager null , array $cellOptions [] )
Constructor.
Cake\Http\ServerRequest
$request
optional null $response
optional null Cake\Event\EventManager
$eventManager
optional null $cellOptions
optional [] __toString( )
Magic method.
Starts the rendering process when Cell is echoed.
Note This method will trigger an error when view rendering has a problem. This is because PHP will not allow a __toString() method to throw an exception.
_cacheConfig( string $action , string|null $template null )
Generate the cache key to use for this cell.
If the key is undefined, the cell class and action name will be used.
$action
$template
optional null render( string|null $template null )
Render the cell.
$template
optional null Custom template name to render. If not provided (null), the last value will be used. This value is automatically set by CellTrait::cell()
.
Cake\View\Exception\MissingCellViewException
dispatchEvent( string $name , array|null $data null , object|null $subject null )
Wrapper for creating and dispatching events.
Returns a dispatched event.
$name
$data
optional null Any value you wish to be transported with this event to it can be read by listeners.
$subject
optional null The object that this event applies to ($this by default).
Cake\Event\Event
eventManager( Cake\Event\EventManager $eventManager null )
Returns the Cake\Event\EventManager manager instance for this object.
You can use this instance to register any new listeners or callbacks to the object events, or create your own events and trigger them at will.
Cake\Event\EventManager
$eventManager
optional null Cake\Event\EventManager
tableLocator( Cake\ORM\Locator\LocatorInterface $tableLocator null )
Sets the table locator. If no parameters are passed, it will return the currently used locator.
Cake\ORM\Locator\LocatorInterface
$tableLocator
optional null Cake\ORM\Locator\LocatorInterface
_setModelClass( string $name )
Set the modelClass and modelKey properties based on conventions.
If the properties are already set they will not be overwritten
$name
loadModel( string|null $modelClass null , string|null $modelType null )
Loads and constructs repository objects required by this object
Typically used to load ORM Table objects as required. Can also be used to load other types of repository objects your application uses.
If a repository provider does not return an object a MissingModelException will be thrown.
$modelClass
optional null $modelType
optional null Cake\Datasource\RepositoryInterface
Cake\Datasource\Exception\MissingModelException
modelFactory( string $type , callable $factory )
Override a existing callable to generate repositories of a given type.
$type
$factory
modelType( string|null $modelType null )
Set or get the model type to be used by this class
$modelType
optional null Cake\Datasource\ModelAwareTrait
createView( string|null $viewClass null )
Constructs the view class instance based on the current configuration.
$viewClass
optional null Cake\View\View
Cake\View\Exception\MissingViewException
set( string|array $name , mixed $value null )
Saves a variable or an associative array of variables for use inside a template.
$name
$value
optional null Value in case $name is a string (which then works as the key). Unused if $name is an associative array, otherwise serves as the values to $name's keys.
viewBuilder( )
Get the view builder being used.
Cake\View\ViewBuilder
viewOptions( string|array|null $options null , boolean $merge true )
Get/Set valid view options in the object's _validViewOptions property. The property is created as an empty array if it is not set. If called without any parameters it will return the current list of valid view options. See createView()
.
$options
optional null $merge
optional true Whether to merge with or override existing valid View options. Defaults to true
.
public Cake\View\View
Instance of the View created during rendering. Won't be set until after Cell::__toString() is called.
protected array
List of valid options (constructor's fourth arguments) Override this property in subclasses to whitelist which options you want set as properties in your Cell.
[]
protected array
These properties can be set directly on Cell and passed to the View as options.
Cake\View\View
[ 'viewPath' ]
public array
The helpers this cell uses.
This property is copied automatically when using the CellTrait
[]
public Cake\Http\ServerRequest
An instance of a Cake\Network\Request object that contains information about the current request. This object contains all the information about a request and several methods for reading additional information about the request.
public Cake\Network\Response
An instance of a Response object that contains information about the impending response
public string
Name of the template that will be rendered. This property is inflected from the action name that was invoked.
© 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.Cell.html