JApplication
Base class for a Joomla! application.
Acts as a Factory class for application specific objects and provides many supporting API functions. Derived clases should supply the route(), dispatch() and render() functions.
Located in /joomla/application/application.php (line 33)
JObject (Subpackage Base)
![]()
JApplication (Subpackage Application)
The
getUserStateFromRequest
(string $key, string $request, [string $default = null], [string $type = 'none'])
none;
redirect
(string $url, [string $msg = ''], [string $msgType = 'message'], [boolean $moved = false])
string
$scope
= null (line 66)
The scope of the application
integer
$_clientId
= null (line 42)
The client identifier.
array
$_messageQueue
= array() (line 50)
The application message queue.
array
$_name
= null (line 58)
The name of the application
Inherited Variables
Inherited from JObject
JObject::$_errors
Class constructor.
- integer $config: A client identifier.
- JObject::__construct()
- Class constructor, overridden in descendant classes.
Deprecated, use JDocument->addCustomTag instead (only when document type is HTML).
- string $html: Valid HTML
Deprecated, use JDocument->setMetaData instead.
- string $name: Name of the metadata tag
- string $content: Content of the metadata tag
- string $prepend: Deprecated, ignored
- string $append: Deprecated, ignored
Deprecated, use JDocument->setMetaData instead.
- string $name: Name of the metadata tag
- string $content: Content of the metadata tag
Deprecated, use JPathWay->addItem() method instead.
- $name
- $link
Dispatch the applicaiton.
Dispatching is the process of pulling the option from the request object and mapping them to a component. If the component does not exist, it handles determining a default component to dispatch.
- $component
Enqueue a system message.
- string $msg: The message to enqueue.
- string $type: The message type.
Deprecated, use JURI::base() instead.
- $client
- $addTrailingSlash
Gets a configuration value.
- string $varname: The name of the value to get.
Deprecated, use JPathway->getPathWayNames() method instead.
Returns a reference to the global JApplication object, only creating it if it doesn't already exist.
This method must be invoked as:
$menu = &JApplication::getInstance();
- mixed $id: A client identifier or name.
- array $config: An optional associative array of configuration settings.
- $client
- $prefix
Return a reference to the application JPathway object.
- array $options: An optional associative array of configuration settings.
- $name
Method to get the application name
The dispatcher name by default parsed using the classname, or it can be set by passing a $config['name'] in the class constructor
Deprecated, use JApplicationHelper::getPath instead.
- $varname
- $user_option
Return a reference to the application JPathway object.
- array $options: An optional associative array of configuration settings.
- $name
Return a reference to the application JRouter object.
- array $options: An optional associative array of configuration settings.
- $name
Gets a user state.
- string $key: The path of the state.
Gets the value of a user state variable.
- string $key: The key of the user state variable.
- string $request: The name of the variable passed in a request.
- string $default: The default value for the variable if not found. Optional.
- string $type: Filter for the variable, for valid values see JFilterInput::clean(). Optional.
Initialise the application.
- array $options: An optional associative array of configuration settings.
Login authentication function.
Username and encoded password are passed the the onLoginUser event which is responsible for the user validation. A successful validation updates the current session record with the users details.
Username and encoded password are sent as credentials (along with other possibilities) to each observer (authentication plugin) for user validation. Successful validation will update the current session with the user details.
- array $credentials: Array( 'username' => string, 'password' => string )
- array $options: Array( 'remember' => boolean )
Logout authentication function.
Passed the current user information to the onLogoutUser event and reverts the current session record back to 'anonymous' parameters.
- int $userid: The user to load - Can be an integer or string - If string, it is converted to ID automatically
- array $options: Array( 'clientid' => array of client id's )
Deprecated, use JDocument->setMetaData instead
- string $name: Name of the metadata tag
- string $content: Content of the metadata tag
Redirect to another URL.
Optionally enqueues a message in the system message queue (which will be displayed the next time a page is loaded) using the enqueueMessage method. If the headers have not been sent the redirect will be accomplished using a "301 Moved Permanently" or "303 See Other" code in the header pointing to the new location depending upon the moved flag. If the headers have already been sent this will be accomplished using a JavaScript statement.
- string $url: The URL to redirect to. Can only be http/https URL
- string $msg: An optional message to display on redirect.
- string $msgType: An optional message type.
- boolean $moved: True if the page is 301 Permanently Moved, otherwise 303 See Other is assumed.
Registers a handler to a particular event group.
- string $event: The event name.
- mixed $handler: The handler, a function or an instance of a event object.
Render the application.
Rendering is the process of pushing the document buffers into the template placeholders, retrieving data from the document and pushing it into the JResponse buffer.
Route the application.
Routing is the process of examining the request environment to determine which component should receive the request. The component optional parameters are then set in the request object to be processed when the application is being dispatched.
Deprecated, use JDocument::setTitle instead.
- $title
Sets the value of a user state variable.
- string $key: The path of the state.
- string $value: The value of the variable.
Calls all handlers associated with an event group.
- string $event: The event name.
- array $args: An array of arguments.
Inherited Methods
Inherited From JObject
JObject::JObject()
JObject::__construct()
JObject::get()
JObject::getError()
JObject::getErrors()
JObject::getProperties()
JObject::getPublicProperties()
JObject::set()
JObject::setError()
JObject::setProperties()
JObject::toString()





JApplication (Subpackage Application)
static