Cell base.
__construct( Cake\Network\Request $request null , Cake\Network\Response $response null , Cake\Event\EventManager $eventManager null , array $cellOptions [] )
Constructor.
Cake\Network\Request
$request
optional null Cake\Network\Response
$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.
string
_cacheConfig( string $template )
Generate the cache key to use for this cell.
If the key is undefined, the cell class and template will be used.
$template
array
render( string|null $template null )
Render the cell.
$template
optional null CellTrait::cell()
.string
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 $subject
optional null 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 object
Cake\Datasource\Exception\MissingModelException
InvalidArgumentException
UnexpectedValueException
modelFactory( string $type , callable $factory )
Register a 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 string|$this
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 , string|array|null|boolean $value null )
Saves a variable or an associative array of variables for use inside a template.
$name
$value
optional null mixed
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 true
.array
protected Cake\Event\EventManager
Instance of the Cake\Event\EventManager this object is using to dispatch inner events.
null
public string
This object's primary model class name. Should be a plural form. CakePHP will not inflect the name.
Example: For an object named 'Comments', the modelClass would be 'Comments'. Plugin classes should use Plugin.Comments
style names to correctly load models from the correct plugin.
public string
The name of default View class.
$this->viewBuilder()->className()
instead.null
© 2005–2016 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.
http://api.cakephp.org/3.1/class-Cake.View.Cell.html