Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques | |
__construct ($config=array(), MVCFactoryInterface $factory=null, ?CMSApplication $app=null, ?Input $input=null) | |
addViewPath ($path) | |
execute ($task) | |
getModel ($name='', $prefix='', $config=array()) | |
getName () | |
getTask () | |
getTasks () | |
getView ($name='', $type='', $prefix='', $config=array()) | |
redirect () | |
registerDefaultTask ($method) | |
registerTask ($task, $method) | |
unregisterTask ($task) | |
setMessage ($text, $type='message') | |
checkToken ($method='post', $redirect=true) | |
setRedirect ($url, $msg=null, $type=null) | |
Fonctions membres publiques hérités de DispatcherAwareInterface | |
setDispatcher (DispatcherInterface $dispatcher) | |
Fonctions membres publiques statiques | |
static | addModelPath ($path, $prefix='') |
static | createFileName ($type, $parts=array()) |
static | getInstance ($prefix, $config=array()) |
Fonctions membres protégées | |
addPath ($type, $path) | |
checkEditId ($context, $id) | |
createModel ($name, $prefix='', $config=array()) | |
createView ($name, $prefix='', $type='', $config=array()) | |
holdEditId ($context, $id) | |
releaseEditId ($context, $id) | |
setPath ($type, $path) | |
Attributs protégés | |
$basePath | |
$default_view | |
$doTask | |
$message | |
$messageType | |
$methods | |
$name | |
$model_prefix | |
$paths | |
$redirect | |
$task | |
$taskMap | |
$input | |
$factory | |
$app | |
Attributs protégés statiques | |
static | $instance |
static | $views |
Base class for a Joomla Controller
Controller (Controllers are where you put all the actual code.) Provides basic functionality, such as rendering views (aka displaying templates).
__construct | ( | $config = array() , |
|
MVCFactoryInterface | $factory = null , |
||
?CMSApplication | $app = null , |
||
?Input | $input = null |
||
) |
Constructor.
array | $config | An optional associative array of configuration settings. Recognized key values include 'name', 'default_task', 'model_path', and 'view_path' (this list is not meant to be comprehensive). |
MVCFactoryInterface | $factory | The factory. |
CMSApplication | $app | The Application for the dispatcher |
Input | $input | Input |
Références $app, $config, $input, $r, $this, Log\addLogger(), Log\ALL, elseif, Factory\getApplication(), JDEBUG, name, et null.
|
static |
Adds to the stack of model paths in LIFO order.
mixed | $path | The directory (string), or list of directories (array) to add. |
string | $prefix | A prefix for models |
Références $path, $prefix, et BaseModel\addIncludePath().
|
protected |
Adds to the search path for templates and resources.
string | $type | The path type (e.g. 'model', 'view'). |
mixed | $path | The directory string or stream array to search. |
Références $dir, $path, $this, $type, et Path\check().
addViewPath | ( | $path | ) |
Add one or more view paths to the controller's stack, in LIFO order.
mixed | $path | The directory (string) or list of directories (array) to add. |
Références $path.
|
protected |
checkToken | ( | $method = 'post' , |
|
$redirect = true |
|||
) |
Checks for a form token in the request.
Use in conjunction with HTMLHelper::_('form.token') or Session::getFormToken.
string | $method | The request method in which to look for the token key. |
boolean | $redirect | Whether to implicitly redirect user to the referrer page on failure or simply return false. |
Références $method, Text\_(), Session\checkToken(), et Uri\isInternal().
|
static |
Create the filename for a resource.
string | $type | The resource type to create the filename for. |
array | $parts | An associative array of filename information. Optional. |
Référencé par LegacyFactory\createView().
|
protected |
Method to load and return a model object.
string | $name | The name of the model. |
string | $prefix | Optional model prefix. |
array | $config | Configuration array for the model. Optional. |
|
protected |
Method to load and return a view object. This method first looks in the current template directory for a match and, failing that, uses a default set path to load the view class file.
Note the "name, prefix, type" order of parameters, which differs from the "name, type, prefix" order used in related public methods.
string | $name | The name of the view. |
string | $prefix | Optional prefix for the view class name. |
string | $type | The type of view. |
array | $config | Configuration array for the view. Optional. |
execute | ( | $task | ) |
Execute a task by triggering a method in the derived class.
string | $task | The task to perform. If no matching task is found, the '__default' task is executed, if defined. |
Implémente ControllerInterface.
Références $task, elseif, et Text\sprintf().
|
static |
Method to get a singleton controller instance.
string | $prefix | The prefix for the controller. |
array | $config | An array of optional constructor options. |
Références $app, $basePath, $class, $config, $format, $input, $path, $prefix, $task, $type, class, elseif, Factory\getApplication(), Factory\getContainer(), InputFilter\getInstance(), Symfony\Contracts\Service\has(), null, et Text\sprintf().
getModel | ( | $name = '' , |
|
$prefix = '' , |
|||
$config = array() |
|||
) |
Method to get a model object, loading it if required.
string | $name | The model name. Optional. |
string | $prefix | The class prefix. Optional. |
array | $config | Configuration array for model. Optional. |
Références $config, $item, $menu, $model, $name, $params, $prefix, Path\clean(), elseif, et JPATH_ADMINISTRATOR.
getName | ( | ) |
getTask | ( | ) |
Get the last task that is being performed or was most recently performed.
Références $task.
getTasks | ( | ) |
Gets the available tasks in the controller.
getView | ( | $name = '' , |
|
$type = '' , |
|||
$prefix = '' , |
|||
$config = array() |
|||
) |
Method to get a reference to the current view and load it if necessary.
string | $name | The view name. Optional, defaults to the controller name. |
string | $type | The view type. Optional. |
string | $prefix | The class prefix. Optional. |
array | $config | Configuration array for view. Optional. |
Références $config, $name, $prefix, $type, $view, Path\clean(), elseif, JPATH_ADMINISTRATOR, et Text\sprintf().
|
protected |
redirect | ( | ) |
Redirects the browser or returns false if no redirect is set.
registerDefaultTask | ( | $method | ) |
registerTask | ( | $task, | |
$method | |||
) |
|
protected |
setMessage | ( | $text, | |
$type = 'message' |
|||
) |
|
protected |
Set a URL for browser redirection.
string | $url | URL to redirect to. |
string | $msg | Message to display on redirect. Optional, defaults to value set internally by controller, if any. |
string | $type | Message type. Optional, defaults to 'message' or the type set by a previous call to setMessage. |
unregisterTask | ( | $task | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |