Свойство | Type | Description | |
---|---|---|---|
$cacheParams | false | array | Variables that should be taken in account while working with the cache. You can set them in Controller constructor or inside onBefore* methods | |
$cacheableTasks | array | The tasks for which caching should be enabled by default | |
$defaultsForAdd | array | An indexed array of default values for the add task. Since the add task resets the model you can't set these values directly to the model. Instead, the defaultsForAdd values will be fed to model's bind() after it's reset and before the session-stored item data is bound to the model object. | |
$hasForm | boolean | Do we have a valid XML form? | |
$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. |
Méthode | Description | |
---|---|---|
__construct ( |
Public constructor of the Controller class. You can pass the following variables in the $config array, on top of what you already have in the base Controller class: | |
add ( ) : void | Single record add. The form layout is used to present a blank page. | |
apply ( ) : void | Save the incoming data and then return to the Edit task | |
archive ( ) : void | Archive (set enabled = 2) an item. | |
browse ( ) : void | Implements a default browse task, i.e. read a bunch of records and send them to the browser. | |
cancel ( ) : void | Cancel the edit, check in the record and return to the Browse task | |
checkin ( ) : void | Check in (unlock) items | |
copy ( ) : void | Duplicates selected items | |
edit ( ) : void | Single record edit. The ID set in the request is passed to the model, then the form layout is used to edit the result. | |
execute ( string $task ) : null | boolean |
Executes a given controller task. The onBefore |
|
forceRemove ( ) : void | Deletes the selected item(s). Unlike remove() this method will force delete the record (completely removed from database) | |
getIDsFromRequest ( |
Gets the list of IDs from the request data | |
getItemidURLSuffix ( ) : string | Gets a URL suffix with the Itemid parameter. If it's not the front-end of the site, or if there is no Itemid set it returns an empty string. | |
getModel ( string $name = null, array $config = [] ) : |
Returns a named Model object. Makes sure that the Model is a database-aware model, throwing an exception otherwise, when $name is null. | |
getView ( string $name = null, array $config = [] ) : |
Returns a named View object | |
loadhistory ( ) : boolean | Method to load a row from version history | |
orderdown ( ) : void | Moves selected items one position down the ordering list | |
orderup ( ) : void | Moves selected items one position up the ordering list | |
publish ( ) : void | Publish (set enabled = 1) an item. | |
read ( ) : void | Single record read. The id set in the request is passed to the model and then the item layout is used to render the result. | |
remove ( ) : void | Delete or trash selected item(s). The model's softDelete flag determines if the items should be trashed (enabled state changed to -2) or deleted (completely removed from database) | |
save ( ) : void | Save the incoming data and then return to the Browse task | |
savenew ( ) : boolean | Save the incoming data and then return to the Add task | |
saveorder ( ) : void | Saves the order of the items | |
trash ( ) : void | Trash (set enabled = -2) an item. | |
unpublish ( ) : void | Unpublish (set enabled = 0) an item. |
Méthode | Description | |
---|---|---|
applySave ( ) : boolean | Common method to handle apply and save tasks | |
checkACL ( string $area ) : boolean | Checks if the current user has enough privileges for the requested ACL area. This overridden method supports asset tracking as well. | |
deleteOrTrash ( $forceDelete = false ) | ||
getACLForApplySave ( ) : boolean | string | Gets the applicable ACL privilege for the apply and save tasks. The value returned is: - @add if the record's ID is empty / record doesn't exist - True if the ACL privilege of the edit task (@edit) is allowed - @editown if the owner of the record (field user_id, userid or user) is the same as the logged in user - False if the record is not owned by the logged in user and the user doesn't have the @edit privilege | |
getCrudTask ( ) : string | Determines the CRUD task to use based on the view name and HTTP verb used in the request. | |
onAfterExecute ( string $task ) : boolean | Deal with JSON format: no redirects needed |
public __construct ( |
||
$container | The application container | |
$config | array | The configuration array |
public forceRemove ( ) : void | ||
Résultat | void |
protected getACLForApplySave ( ) : boolean | string | ||
Résultat | boolean | string |
protected getCrudTask ( ) : string | ||
Résultat | string | The CRUD task (browse, read, edit, delete) |
public getIDsFromRequest ( |
||
$model | The model where the record will be loaded | |
$loadRecord | boolean | When true, the record matching the *first* ID found will be loaded into $model |
Résultat | array |
public getItemidURLSuffix ( ) : string | ||
Résultat | string | The &Itemid=123 URL suffix, or an empty string if Itemid is not applicable |
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 |
Résultat | 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 |
Résultat | The instance of the Model known to this Controller |
public loadhistory ( ) : boolean | ||
Résultat | boolean | True if the content history is reverted, false otherwise |
protected onAfterExecute ( string $task ) : boolean | ||
$task | string | The task being executed |
Résultat | boolean | True if everything went well |
protected false|array $cacheParams | ||
Résultat | false | array |
protected array $cacheableTasks | ||
Résultat | array |
protected array $defaultsForAdd | ||
Résultat | array |
protected bool $hasForm | ||
Résultat | boolean |
protected array $taskPrivileges | ||
Résultat | array |