BaseController
class BaseController extends JObject
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).
Methods
Adds to the stack of model paths in LIFO order.
Method to get a singleton controller instance.
Constructor.
Add one or more view paths to the controller's stack, in LIFO order.
Authorisation check
Typical view method for MVC based architecture
Execute a task by triggering a method in the derived class.
Method to get a model object, loading it if required.
Method to get the controller name
Get the last task that is being performed or was most recently performed.
Gets the available tasks in the controller.
Method to get a reference to the current view and load it if necessary.
Redirects the browser or returns false if no redirect is set.
Register the default task to perform if a mapping is not found.
Register (map) a task to a method in the class.
Unregister (unmap) a task in the class.
Sets the internal message that is passed with a redirect
Checks for a form token in the request.
Set a URL for browser redirection.
Details
static
void
addModelPath(
mixed $path,
string $prefix = '')
Adds to the stack of model paths in LIFO order.
static
JControllerLegacy
getInstance(
string $prefix,
array $config = array())
Method to get a singleton controller instance.
JControllerLegacy
addViewPath(
mixed $path)
Add one or more view paths to the controller's stack, in LIFO order.
JControllerLegacy
display(
boolean $cachable = false,
array $urlparams = array())
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.
JModelLegacy|boolean
getModel(
string $name = '',
string $prefix = '',
array $config = array())
Method to get a model object, loading it if required.
string
getName()
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
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.
JControllerLegacy
registerDefaultTask(
string $method)
Register the default task to perform if a mapping is not found.
JControllerLegacy
registerTask(
string $task,
string $method)
Register (map) a task to a method in the class.
string
setMessage(
string $text,
string $type = 'message')
Sets the internal message that is passed with a redirect