Cell base.
string 'cell'
Constant for folder name containing cell templates.
Cake\View\ViewInstance of the View created during rendering. Won't be set until after Cell::__toString()/render() is called.
array|boolCaching setup.
stringDefault class name for new event objects.
Cake\Event\EventManagerInterface|nullInstance of the Cake\Event\EventManager this object is using to dispatch inner events.
array<callableCake\Datasource\Locator\LocatorInterface>A list of overridden model factory functions.
stringThe model type to use.
Cake\ORM\Locator\LocatorInterface|nullTable locator instance
array<string>List of valid options (constructor's fourth arguments) Override this property in subclasses to allow which options you want set as properties in your Cell.
Cake\View\ViewBuilder|nullThe view builder instance being used.
stringThe cell's action to invoke.
arrayArguments to pass to cell's action.
string|nullThis object's default table alias.
string|nullThis object's primary model class name. Should be a plural form. CakePHP will not inflect the name.
Cake\Http\ServerRequestAn instance of a Cake\Http\ServerRequest 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.
Cake\Http\ResponseAn instance of a Response object that contains information about the impending response
Constructor.
Debug info.
Magic method.
Generate the cache key to use for this cell.
Set the modelClass property based on conventions.
Constructs the view class instance based on the current configuration.
Wrapper for creating and dispatching events.
Convenience method to get a table instance.
Returns the Cake\Event\EventManager manager instance for this object.
Get the model type to be used by this class
Gets the table locator.
Initialization hook method.
Loads and constructs repository objects required by this object
Override a existing callable to generate repositories of a given type.
Render the cell.
Saves a variable or an associative array of variables for use inside a template.
Returns the Cake\Event\EventManagerInterface instance for this object.
Set the model type to be used by this class
Sets the table locator.
Get the view builder being used.
__construct(Cake\Http\ServerRequest $request, Cake\Http\Response $response, Cake\Event\EventManagerInterface|null $eventManager = null, array<string, mixed> $cellOptions = [])
Constructor.
Cake\Http\ServerRequest $request The request to use in the cell.
Cake\Http\Response $response The response to use in the cell.
Cake\Event\EventManagerInterface|null $eventManager optional The eventManager to bind events to.
array<string, mixed> $cellOptions optional Cell options to apply.
__debugInfo(): array<string, mixed>
Debug info.
array<string, mixed>__toString(): string
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.
stringError_cacheConfig(string $action, string|null $template = null): array
Generate the cache key to use for this cell.
If the key is undefined, the cell class and action name will be used.
string $action The action invoked.
string|null $template optional The name of the template to be rendered.
array_setModelClass(string $name): void
Set the modelClass property based on conventions.
If the property is already set it will not be overwritten
string $name Class name.
voidcreateView(string|null $viewClass = null): Cake\View\View
Constructs the view class instance based on the current configuration.
string|null $viewClass optional Optional namespaced class name of the View class to instantiate.
Cake\View\ViewCake\View\Exception\MissingViewExceptiondispatchEvent(string $name, array|null $data = null, object|null $subject = null): Cake\Event\EventInterface
Wrapper for creating and dispatching events.
Returns a dispatched event.
string $name Name of the event.
array|null $data optional Any value you wish to be transported with this event to it can be read by listeners.
object|null $subject optional The object that this event applies to ($this by default).
Cake\Event\EventInterfacefetchTable(string|null $alias = null, array<string, mixed> $options = []): Cake\ORM\Table
Convenience method to get a table instance.
string|null $alias optional The alias name you want to get. Should be in CamelCase format. If null then the value of $defaultTable property is used.
array<string, mixed> $options optional The options you want to build the table with. If a table has already been loaded the registry options will be ignored.
Cake\ORM\TableCake\Core\Exception\CakeExceptiongetEventManager(): Cake\Event\EventManagerInterface
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\EventManagerInterfacegetModelType(): string
Get the model type to be used by this class
stringgetTableLocator(): Cake\ORM\Locator\LocatorInterface
Gets the table locator.
Cake\ORM\Locator\LocatorInterfaceinitialize(): void
Initialization hook method.
Implement this method to avoid having to overwrite the constructor and calling parent::__construct().
voidloadModel(string|null $modelClass = null, string|null $modelType = null): Cake\Datasource\RepositoryInterface
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.
string|null $modelClass optional Name of model class to load. Defaults to $this->modelClass. The name can be an alias like 'Post' or FQCN like App\Model\Table\PostsTable::class.
string|null $modelType optional The type of repository to load. Defaults to the getModelType() value.
Cake\Datasource\RepositoryInterfaceCake\Datasource\Exception\MissingModelExceptionUnexpectedValueExceptionmodelFactory(string $type, Cake\Datasource\Locator\LocatorInterface|callable $factory): void
Override a existing callable to generate repositories of a given type.
string $type The name of the repository type the factory function is for.
Cake\Datasource\Locator\LocatorInterface|callable $factory The factory function used to create instances.
voidrender(string|null $template = null): string
Render the cell.
string|null $template optional Custom template name to render. If not provided (null), the last value will be used. This value is automatically set by CellTrait::cell().
stringCake\View\Exception\MissingCellTemplateExceptionBadMethodCallExceptionset(array|string $name, mixed $value = null): $this
Saves a variable or an associative array of variables for use inside a template.
array|string $name A string or an array of data.
mixed $value optional 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.
$thissetEventManager(Cake\Event\EventManagerInterface $eventManager): $this
Returns the Cake\Event\EventManagerInterface 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\EventManagerInterface $eventManager the eventManager to set
$thissetModelType(string $modelType): $this
Set the model type to be used by this class
string $modelType The model type
$thissetTableLocator(Cake\ORM\Locator\LocatorInterface $tableLocator): $this
Sets the table locator.
Cake\ORM\Locator\LocatorInterface $tableLocator LocatorInterface instance.
$thisviewBuilder(): Cake\View\ViewBuilder
Get the view builder being used.
Cake\View\ViewBuilderInstance of the View created during rendering. Won't be set until after Cell::__toString()/render() is called.
Cake\View\ViewCaching setup.
array|boolDefault class name for new event objects.
stringInstance of the Cake\Event\EventManager this object is using to dispatch inner events.
Cake\Event\EventManagerInterface|nullA list of overridden model factory functions.
array<callableCake\Datasource\Locator\LocatorInterface>The model type to use.
stringTable locator instance
Cake\ORM\Locator\LocatorInterface|nullList of valid options (constructor's fourth arguments) Override this property in subclasses to allow which options you want set as properties in your Cell.
array<string>The view builder instance being used.
Cake\View\ViewBuilder|nullThe cell's action to invoke.
stringArguments to pass to cell's action.
arrayThis object's default table alias.
string|nullThis 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.
Use empty string to not use auto-loading on this object. Null auto-detects based on controller name.
string|nullAn instance of a Cake\Http\ServerRequest 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.
Cake\Http\ServerRequestAn instance of a Response object that contains information about the impending response
Cake\Http\Response
© 2005–present 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/4.4/class-Cake.View.Cell.html