public static
|
#
addModelPath( mixed $path, string $prefix = '' )
Adds to the stack of model paths in LIFO order.
Adds to the stack of model paths in LIFO order.
Parameters
- $path
mixed - $path The directory (string), or list of directories (array) to add.
- $prefix
string - $prefix A prefix for models
Since
3.0
|
protected static
string
|
#
createFileName( string $type, array $parts = array() )
Create the filename for a resource.
Create the filename for a resource.
Parameters
- $type
string - $type The resource type to create the filename for.
- $parts
array - $parts An associative array of filename information. Optional.
Returns
string - The filename.
Since
3.0
|
public static
JControllerLegacy
|
#
getInstance( string $prefix, array $config = array() )
Method to get a singleton controller instance.
Method to get a singleton controller instance.
Parameters
- $prefix
string - $prefix The prefix for the controller.
- $config
array - $config An array of optional constructor options.
Returns
Throws
Exception
- if the controller cannot be loaded.
Since
3.0
|
public
|
#
__construct( array $config = array() )
Constructor.
Parameters
- $config
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).
Since
3.0
Overrides
|
protected
JControllerLegacy
|
#
addPath( string $type, mixed $path )
Adds to the search path for templates and resources.
Adds to the search path for templates and resources.
Parameters
- $type
string - $type The path type (e.g. 'model', 'view').
- $path
mixed - $path The directory string or stream array to search.
Returns
Since
3.0
|
public
JControllerLegacy
|
#
addViewPath( mixed $path )
Add one or more view paths to the controller's stack, in LIFO order.
Add one or more view paths to the controller's stack, in LIFO order.
Parameters
- $path
mixed - $path The directory (string) or list of directories (array) to add.
Returns
Since
3.0
|
public
boolean
|
#
authorise( string $task )
Authorisation check
Deprecated
3.0 Use JAccess instead.
Parameters
- $task
string - $task The ACO Section Value to check access on.
Returns
boolean - True if authorised
Since
3.0
|
protected
boolean
|
#
checkEditId( string $context, integer $id )
Method to check whether an ID is in the edit list.
Method to check whether an ID is in the edit list.
Parameters
- $context
string - $context The context for the session storage.
- $id
integer - $id The ID of the record to add to the edit list.
Returns
boolean - True if the ID is in the edit list.
Since
3.0
|
protected
JModelLegacy |boolean
|
#
createModel( string $name, string $prefix = '', array $config = array() )
Method to load and return a model object.
Method to load and return a model object.
Parameters
- $name
string - $name The name of the model.
- $prefix
string - $prefix Optional model prefix.
- $config
array - $config Configuration array for the model. Optional.
Returns
JModelLegacy |boolean
- Model object on success; otherwise false on failure.
Since
3.0
|
protected
JViewLegacy |null
|
#
createView( string $name, string $prefix = '', string $type = '', array $config = array() )
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.
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.
Parameters
- $name
string - $name The name of the view.
- $prefix
string - $prefix Optional prefix for the view class name.
- $type
string - $type The type of view.
- $config
array - $config Configuration array for the view. Optional.
Returns
JViewLegacy |null
- View object on success; null or error result on failure.
Throws
Since
3.0
|
public
JControllerLegacy
|
#
display( boolean $cachable = false, array $urlparams = array() )
Typical view method for MVC based architecture
Typical view method for MVC based architecture
This function is provide as a default implementation, in most cases you will
need to override it in your own controllers.
Parameters
- $cachable
boolean - $cachable If true, the view output will be cached
- $urlparams
array - $urlparams An array of safe URL parameters and their variable types, for valid
values see JFilterInput::clean() .
Returns
Since
3.0
|
public
mixed
|
#
execute( string $task )
Execute a task by triggering a method in the derived class.
Execute a task by triggering a method in the derived class.
Parameters
- $task
string - $task The task to perform. If no matching task is found, the '__default' task is
executed, if defined.
Returns
mixed - The value returned by the called method.
Throws
Since
3.0
|
public
JModelLegacy |boolean
|
#
getModel( string $name = '', string $prefix = '', array $config = array() )
Method to get a model object, loading it if required.
Method to get a model object, loading it if required.
Parameters
- $name
string - $name The model name. Optional.
- $prefix
string - $prefix The class prefix. Optional.
- $config
array - $config Configuration array for model. Optional.
Returns
JModelLegacy |boolean
- Model object on success; otherwise false on failure.
Since
3.0
|
public
string
|
#
getName( )
Method to get the controller name
Method to get the controller name
The dispatcher name is set by default parsed using the classname, or it can
be set by passing a $config['name'] in the class constructor
Returns
string - The name of the dispatcher
Throws
Since
3.0
|
public
string
|
#
getTask( )
Get the last task that is being performed or was most recently performed.
Get the last task that is being performed or was most recently performed.
Returns
string - The task that is being performed or was most recently performed.
Since
3.0
|
public
array
|
#
getTasks( )
Gets the available tasks in the controller.
Gets the available tasks in the controller.
Returns
array - Array[i] of task names.
Since
3.0
|
public
JViewLegacy
|
#
getView( string $name = '', string $type = '', string $prefix = '', array $config = array() )
Method to get a reference to the current view and load it if necessary.
Method to get a reference to the current view and load it if necessary.
Parameters
- $name
string - $name The view name. Optional, defaults to the controller name.
- $type
string - $type The view type. Optional.
- $prefix
string - $prefix The class prefix. Optional.
- $config
array - $config Configuration array for view. Optional.
Returns
Throws
Since
3.0
|
protected
|
#
holdEditId( string $context, integer $id )
Method to add a record ID to the edit list.
Method to add a record ID to the edit list.
Parameters
- $context
string - $context The context for the session storage.
- $id
integer - $id The ID of the record to add to the edit list.
Since
3.0
|
public
boolean
|
#
redirect( )
Redirects the browser or returns false if no redirect is set.
Redirects the browser or returns false if no redirect is set.
Returns
boolean - False if no redirect exists.
Since
3.0
|
public
JControllerLegacy
|
#
registerDefaultTask( string $method )
Register the default task to perform if a mapping is not found.
Register the default task to perform if a mapping is not found.
Parameters
- $method
string - $method The name of the method in the derived class to perform if a named task
is not found.
Returns
Since
3.0
|
public
JControllerLegacy
|
#
registerTask( string $task, string $method )
Register (map) a task to a method in the class.
Register (map) a task to a method in the class.
Parameters
- $task
string - $task The task.
- $method
string - $method The name of the method in the derived class to perform for this task.
Returns
Since
3.0
|
public
JControllerLegacy
|
#
unregisterTask( string $task )
Unregister (unmap) a task in the class.
Unregister (unmap) a task in the class.
Parameters
- $task
string - $task The task.
Returns
Since
3.0
|
protected
|
#
releaseEditId( string $context, integer $id )
Method to check whether an ID is in the edit list.
Method to check whether an ID is in the edit list.
Parameters
- $context
string - $context The context for the session storage.
- $id
integer - $id The ID of the record to add to the edit list.
Since
3.0
|
public
string
|
#
setMessage( string $text, string $type = 'message' )
Sets the internal message that is passed with a redirect
Sets the internal message that is passed with a redirect
Parameters
- $text
string - $text Message to display on redirect.
- $type
string - $type Message type. Optional, defaults to 'message'.
Returns
string - Previous message
Since
3.0
|
protected
|
#
setPath( string $type, string $path )
Sets an entire array of search paths for resources.
Sets an entire array of search paths for resources.
Parameters
- $type
string - $type The type of path to set, typically 'view' or 'model'.
- $path
string - $path The new set of search paths. If null or false, resets to the current
directory only.
Since
3.0
|
public
boolean
|
#
checkToken( string $method = 'post', boolean $redirect = true )
Checks for a form token in the request.
Checks for a form token in the request.
Use in conjunction with JHtml::_('form.token') or JSession::getFormToken.
Parameters
- $method
string - $method The request method in which to look for the token key.
- $redirect
boolean - $redirect Whether to implicitly redirect user to the referrer page on failure or
simply return false.
Returns
boolean - True if found and valid, otherwise return false or redirect to referrer page.
Since
3.7.0
See
|
public
JControllerLegacy
|
#
setRedirect( string $url, string $msg = null, string $type = null )
Set a URL for browser redirection.
Set a URL for browser redirection.
Parameters
- $url
string - $url URL to redirect to.
- $msg
string - $msg Message to display on redirect. Optional, defaults to value set internally
by controller, if any.
- $type
string - $type Message type. Optional, defaults to 'message' or the type set by a
previous call to setMessage.
Returns
Since
3.0
|
protected
string
|
$basePath
|
#
The base path of the controller
The base path of the controller
Since
3.0
|
protected
string
|
$default_view
|
#
The default view for the display method.
The default view for the display method.
Since
3.0
|
protected
string
|
$doTask
|
#
The mapped task that was performed.
The mapped task that was performed.
Since
3.0
|
protected
string
|
$message
|
#
Redirect message.
Since
3.0
|
protected
string
|
$messageType
|
#
Redirect message type.
Since
3.0
|
protected
array
|
$methods
|
#
Array of class methods
Since
3.0
|
protected
array
|
$name
|
#
The name of the controller
The name of the controller
Since
3.0
|
protected
string
|
$model_prefix
|
#
The prefix of the models
Since
3.0
|
protected
array
|
$paths
|
#
The set of search directories for resources (views).
The set of search directories for resources (views).
Since
3.0
|
protected
string
|
$redirect
|
#
URL for redirection.
Since
3.0
|
protected
string
|
$task
|
#
Current or most recently performed task.
Current or most recently performed task.
Since
3.0
|
protected
array
|
$taskMap
|
#
Array of class methods to call for a given task.
Array of class methods to call for a given task.
Since
3.0
|
protected
JInput
|
$input
|
#
Hold a JInput object for easier access to the input variables.
Hold a JInput object for easier access to the input variables.
Since
3.0
|
protected static
JControllerLegacy
|
$instance
|
#
Instance container.
Since
3.0
|
protected static
JViewLegacy[]
|
$views
|
#
Instance container containing the views.
Instance container containing the views.
Since
3.4
|