Свойство | Тип | Описание | |
---|---|---|---|
$autoRouting | integer | 0 = never 1 = frontend only 2 = backend only 3 = always | |
$cacheableTasks | array | The tasks for which caching should be enabled by default | |
$config | array | A cached copy of the class configuration parameter passed during initialisation | |
$container | The container attached to this Controller | ||
$csrfProtection | integer | 0 Disabled; no token checks are performed 1 Enabled; token checks are always performed 2 Only on HTML requests and backend; token checks are always performed in the back-end and in the front-end only when format is 'html' 3 Only on back-end; token checks are performed only in the back-end | |
$doTask | string | The mapped task that was performed. | |
$instance | Instance container. | ||
$layout | string | The current layout; you can override it in the configuration | |
$message | string | Redirect message. | |
$messageType | string | Redirect message type. | |
$methods | array | Array of class methods | |
$modelInstances | array[Model] | An array of Model instances known to this Controller | |
$modelName | string | Overrides the name of the view's default model | |
$name | array | The name of the controller | |
$paths | array | The set of search directories for resources (views). | |
$redirect | string | URL for redirection. | |
$task | string | Current or most recently performed task. | |
$taskMap | array | Array of class methods to call for a given task. | |
$taskPrivileges | array | You can use the notation '@task' which means 'apply the same privileges as "task"'. If you create a reference back to yourself (e.g. 'mytask' => array('@mytask')) it will return TRUE. | |
$view | string | The current view name; you can override it in the configuration | |
$viewInstances | array[View] | An array of View instances known to this Controller | |
$viewName | string | Overrides the name of the view's default view |
Метод | Описание | |
---|---|---|
__construct ( |
Public constructor of the Controller class. You can pass the following variables in the $config array: name string The name of the Controller. Default: auto detect from the class name default_task string The task to use when none is specified. Default: main autoRouting int See the autoRouting property csrfProtection int See the csrfProtection property viewName string The view name. Default: the same as the controller name modelName string The model name. Default: the same as the controller name viewConfig array The configuration overrides for the View. | |
__get ( string $name ) : mixed | null | Magic get method. Handles magic properties: $this->input mapped to $this->container->input | |
display ( boolean $cachable = false, boolean $urlparams = false, string $tpl = null ) : void | Default task. Assigns a model to the view and asks the view to render itself. | |
execute ( string $task ) : null | boolean |
Executes a given controller task. The onBefore |
|
getModel ( string $name = null, array $config = [] ) : |
Returns a named Model object | |
getName ( ) : string | Method to get the controller name | |
getTask ( ) : string | Get the last task that is being performed or was most recently performed. | |
getTasks ( ) : array | Gets the available tasks in the controller. | |
getView ( string $name = null, array $config = [] ) : |
Returns a named View object | |
hasRedirect ( ) : boolean | Returns true if there is a redirect set in the controller | |
main ( ) | Alias to the display() task | |
redirect ( ) : boolean | Redirects the browser or returns false if no redirect is set. | |
registerDefaultTask ( string $method ) : |
Register the default task to perform if a mapping is not found. | |
registerTask ( string $task, string $method ) : |
Register (map) a task to a method in the class. | |
setMessage ( string $text, string $type = 'message' ) : string | Sets the internal message that is passed with a redirect | |
setModel ( string $modelName, |
Pushes a named model to the Controller | |
setModelName ( string $modelName ) : void | Set the name of the model to be used by this Controller | |
setRedirect ( string $url, string $msg = null, string $type = null ) : |
Set a URL for browser redirection. | |
setView ( string $viewName, |
Pushes a named view to the Controller | |
setViewName ( string $viewName ) : void | Set the name of the view to be used by this Controller | |
unregisterTask ( string $task ) : |
Unregister (unmap) a task in the class. |
Метод | Описание | |
---|---|---|
checkACL ( string $area ) : boolean | Checks if the current user has enough privileges for the requested ACL area. | |
csrfProtection ( ) : boolean | Provides CSRF protection through the forced use of a secure token. If the token doesn't match the one in the session we return false. | |
getACLRuleFor ( string $area, array $oldAreas = [] ) : mixed | Resolves @task and &callback notations for ACL privileges | |
triggerEvent ( string $event, array $arguments = [] ) : boolean | Triggers an object-specific event. The event runs both locally –if a suitable method exists– and through the Joomla! plugin system. A true/false return value is expected. The first false return cancels the event. |
public __construct ( |
||
$container | The application container | |
$config | array | The configuration array |
Результат |
protected csrfProtection ( ) : boolean | ||
Результат | boolean |
public getModel ( string $name = null, array $config = [] ) : |
||
$name | string | The Model name. If null we'll use the modelName variable or, if it's empty, the same name as the Controller |
$config | array | Configuration parameters to the Model. If skipped we will use $this->config |
Результат | The instance of the Model known to this Controller |
public getView ( string $name = null, array $config = [] ) : |
||
$name | string | The Model name. If null we'll use the modelName variable or, if it's empty, the same name as the Controller |
$config | array | Configuration parameters to the Model. If skipped we will use $this->config |
Результат | The instance of the Model known to this Controller |
public hasRedirect ( ) : boolean | ||
Результат | boolean |
public registerDefaultTask ( string $method ) : |
||
$method | string | The name of the method in the derived class to perform if a named task is not found. |
Результат | This object to support chaining. |
public registerTask ( string $task, string $method ) : |
||
$task | string | The task. |
$method | string | The name of the method in the derived class to perform for this task. |
Результат | This object to support chaining. |
public setModelName ( string $modelName ) : void | ||
$modelName | string | The name of the model |
Результат | void |
public setRedirect ( string $url, string $msg = null, string $type = null ) : |
||
$url | string | URL to redirect to. |
$msg | string | Message to display on redirect. Optional, defaults to value set internally by controller, if any. |
$type | string | Message type. Optional, defaults to 'message' or the type set by a previous call to setMessage. |
Результат | This object to support chaining. |
public setViewName ( string $viewName ) : void | ||
$viewName | string | The name of the view |
Результат | void |
public unregisterTask ( string $task ) : |
||
$task | string | The task. |
Результат | This object to support chaining. |
protected int $autoRouting | ||
Результат | integer |
protected array $cacheableTasks | ||
Результат | array |
protected array $config | ||
Результат | array |
protected Container,FOF30\Container $container | ||
Результат |
protected int $csrfProtection | ||
Результат | integer |
protected string $doTask | ||
Результат | string |
protected static Controller,FOF30\Controller $instance | ||
Результат |
protected string $layout | ||
Результат | string |
protected string $messageType | ||
Результат | string |
protected array[Model] $modelInstances | ||
Результат | array[Model] |
protected string $modelName | ||
Результат | string |
protected array $paths | ||
Результат | array |
protected string $task | ||
Результат | string |
protected array $taskMap | ||
Результат | array |
protected array $taskPrivileges | ||
Результат | array |
protected string $view | ||
Результат | string |
protected array[View] $viewInstances | ||
Результат | array[View] |
protected string $viewName | ||
Результат | string |