Difference between revisions of "JApplication"
From Joomla! Documentation
(Layout updates) |
m (preparing for archive only) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | + | =={{JVer|11.1}} JApplication== | |
− | + | ===Description=== | |
− | + | JApplication is the base class for a Joomla Application. It 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. | |
− | {{ | + | |
− | |||
− | |||
− | |||
− | === | ||
− | |||
− | |||
− | |||
− | |||
===Methods=== | ===Methods=== | ||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
|- | |- | ||
+ | !Visibility | ||
!Method name | !Method name | ||
!Description | !Description | ||
|- | |- | ||
− | |[[JApplication::__construct | + | |public |
+ | |[[API17:JApplication::__construct|__construct]] | ||
|Class constructor. | |Class constructor. | ||
|- | |- | ||
− | |[[JApplication::__toString | + | |public |
+ | |[[API17:JApplication::__toString|__toString]] | ||
|Returns the response. | |Returns the response. | ||
|- | |- | ||
− | |[[JApplication::checkSession | + | |public |
+ | |[[API17:JApplication::checkSession|checkSession]] | ||
|Checks the user session. | |Checks the user session. | ||
|- | |- | ||
− | |[[JApplication::close | + | |public |
+ | |[[API17:JApplication::close|close]] | ||
|Exit the application. | |Exit the application. | ||
|- | |- | ||
− | |[[JApplication::dispatch | + | |public |
+ | |[[API17:JApplication::dispatch|dispatch]] | ||
|Dispatch the applicaiton. | |Dispatch the applicaiton. | ||
|- | |- | ||
− | |[[JApplication::enqueueMessage | + | |public |
+ | |[[API17:JApplication::enqueueMessage|enqueueMessage]] | ||
|Enqueue a system message. | |Enqueue a system message. | ||
|- | |- | ||
− | |[[JApplication::getCfg | + | |public |
+ | |[[API17:JApplication::getCfg|getCfg]] | ||
| | | | ||
|- | |- | ||
− | |[[JApplication::getClientId | + | |public |
+ | |[[API17:JApplication::getClientId|getClientId]] | ||
|Gets the client id of the current running application. | |Gets the client id of the current running application. | ||
|- | |- | ||
− | |[[JApplication::getMenu | + | |public |
+ | |[[API17:JApplication::getMenu|getMenu]] | ||
|Returns the application object. | |Returns the application object. | ||
|- | |- | ||
− | |[[JApplication::getMessageQueue | + | |public |
+ | |[[API17:JApplication::getMessageQueue|getMessageQueue]] | ||
|Get the system message queue. | |Get the system message queue. | ||
|- | |- | ||
− | |[[JApplication::getName | + | |public |
+ | |[[API17:JApplication::getName|getName]] | ||
|Method to get the application name. | |Method to get the application name. | ||
|- | |- | ||
− | |[[JApplication::getPathway | + | |public |
+ | |[[API17:JApplication::getPathway|getPathway]] | ||
|Returns the application object. | |Returns the application object. | ||
|- | |- | ||
− | |[[JApplication::getTemplate | + | |public |
+ | |[[API17:JApplication::getTemplate|getTemplate]] | ||
|Gets the name of the current template. | |Gets the name of the current template. | ||
|- | |- | ||
− | |[[JApplication::getUserState | + | |public |
+ | |[[API17:JApplication::getUserState|getUserState]] | ||
|Gets a user state. | |Gets a user state. | ||
|- | |- | ||
− | |[[JApplication::getUserStateFromRequest | + | |public |
+ | |[[API17:JApplication::getUserStateFromRequest|getUserStateFromRequest]] | ||
|Gets the value of a user state variable. | |Gets the value of a user state variable. | ||
|- | |- | ||
− | |[[JApplication::initialise | + | |public |
+ | |[[API17:JApplication::initialise|initialise]] | ||
|Initialise the application. | |Initialise the application. | ||
|- | |- | ||
− | |[[JApplication::isAdmin | + | |public |
+ | |[[API17:JApplication::isAdmin|isAdmin]] | ||
|Is admin interface? | |Is admin interface? | ||
|- | |- | ||
− | |[[JApplication::isSite | + | |public |
+ | |[[API17:JApplication::isSite|isSite]] | ||
|Is site interface? | |Is site interface? | ||
|- | |- | ||
− | |[[JApplication::login | + | |public |
+ | |[[API17:JApplication::login|login]] | ||
|Login authentication function. | |Login authentication function. | ||
|- | |- | ||
− | |[[JApplication::logout | + | |public |
+ | |[[API17:JApplication::logout|logout]] | ||
|Logout authentication function. | |Logout authentication function. | ||
|- | |- | ||
− | |[[JApplication::redirect | + | |public |
+ | |[[API17:JApplication::redirect|redirect]] | ||
|Redirect to another URL. | |Redirect to another URL. | ||
|- | |- | ||
− | |[[JApplication::render | + | |public |
+ | |[[API17:JApplication::render|render]] | ||
|Render the application. | |Render the application. | ||
|- | |- | ||
− | |[[JApplication::route | + | |public |
+ | |[[API17:JApplication::route|route]] | ||
|Route the application. | |Route the application. | ||
|- | |- | ||
− | |[[JApplication::setUserState | + | |public |
+ | |[[API17:JApplication::setUserState|setUserState]] | ||
|Sets the value of a user state variable. | |Sets the value of a user state variable. | ||
|- | |- | ||
− | |[[JApplication::triggerEvent | + | |public |
+ | |[[API17:JApplication::triggerEvent|triggerEvent]] | ||
|Calls all handlers associated with an event group. | |Calls all handlers associated with an event group. | ||
|- | |- | ||
− | |[[JApplication::getHash | + | |public static |
+ | |[[API17:JApplication::getHash|getHash]] | ||
|Provides a secure hash based on a seed. | |Provides a secure hash based on a seed. | ||
|- | |- | ||
− | |[[JApplication::getInstance | + | |public static |
+ | |[[API17:JApplication::getInstance|getInstance]] | ||
|Returns the global object, only creating it if it doesn't already exist. | |Returns the global object, only creating it if it doesn't already exist. | ||
|- | |- | ||
− | |[[JApplication::getRouter | + | |public static |
+ | |[[API17:JApplication::getRouter|getRouter]] | ||
|Returns the application object. | |Returns the application object. | ||
|- | |- | ||
− | |[[JApplication::isWinOS | + | |public static |
+ | |[[API17:JApplication::isWinOS|isWinOS]] | ||
|Method to determine if the host OS is Windows. | |Method to determine if the host OS is Windows. | ||
|- | |- | ||
− | |[[JApplication::registerEvent | + | |public static |
+ | |[[API17:JApplication::registerEvent|registerEvent]] | ||
|Registers a handler to a particular event group. | |Registers a handler to a particular event group. | ||
|- | |- | ||
− | |[[JApplication::stringURLSafe | + | |public static |
+ | |[[API17:JApplication::stringURLSafe|stringURLSafe]] | ||
|This method transliterates a string into an URL safe string or returns a URL safe UTF-8 string based on the global configuration. | |This method transliterates a string into an URL safe string or returns a URL safe UTF-8 string based on the global configuration. | ||
|- | |- | ||
− | |[[JApplication::_createConfiguration | + | |protected |
+ | |[[API17:JApplication::_createConfiguration|_createConfiguration]] | ||
|Create the configuration registry. | |Create the configuration registry. | ||
|- | |- | ||
− | |[[JApplication::_createSession | + | |protected |
+ | |[[API17:JApplication::_createSession|_createSession]] | ||
|Create the user session. | |Create the user session. | ||
|- | |- | ||
|} | |} | ||
+ | * '''Defined in''' libraries/joomla/application/application.php | ||
+ | * '''Extends''' [[API17:JObject|JObject]] | ||
===Importing=== | ===Importing=== | ||
<source lang="php">jimport( 'joomla.application.application' );</source> | <source lang="php">jimport( 'joomla.application.application' );</source> | ||
===See also=== | ===See also=== | ||
− | * JApplication source code | + | * {{JVer|11.1}} '''JApplication source code''' on [[jplatform:application/application.php|BitBucket]] |
− | * [[JApplication|Other versions of | + | * {{JVer|11.1}} Subpackage [[API17:Subpackage Application|Application]] |
− | {{ | + | * [[API17:JApplication|Other versions of JApplication]] |
− | + | ===See Also=== | |
− | + | * {{JVer|1.5}} '''JApplication''' on [https://api.joomla.org/1.5/Joomla-Framework/Application/JApplication.html api.joomla.org] | |
− | + | * {{JVer|1.5}} '''JApplication source code''' on [[jframework15:application/application.php|JoomlaCode]] | |
− | ===Examples=== | + | * {{JVer|1.5}} Subpackage Application |
− | + | ||
+ | ===User contributed notes=== | ||
+ | === Code Examples === | ||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=JApplication | category=JApplication | ||
− | + | namespace=CodeExample | |
category=ClassExample | category=ClassExample | ||
include=* | include=* | ||
+ | namespace=CodeExample | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
− | <noinclude> | + | <noinclude>[[Category:Platform 11.1]][[Category:Archived pages API17]]</noinclude> |
Latest revision as of 21:18, 24 March 2017
The "API17" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
JApplication[edit]
Description[edit]
JApplication is the base class for a Joomla Application. It 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.
Methods[edit]
Visibility | Method name | Description |
---|---|---|
public | __construct | Class constructor. |
public | __toString | Returns the response. |
public | checkSession | Checks the user session. |
public | close | Exit the application. |
public | dispatch | Dispatch the applicaiton. |
public | enqueueMessage | Enqueue a system message. |
public | getCfg | |
public | getClientId | Gets the client id of the current running application. |
public | getMenu | Returns the application object. |
public | getMessageQueue | Get the system message queue. |
public | getName | Method to get the application name. |
public | getPathway | Returns the application object. |
public | getTemplate | Gets the name of the current template. |
public | getUserState | Gets a user state. |
public | getUserStateFromRequest | Gets the value of a user state variable. |
public | initialise | Initialise the application. |
public | isAdmin | Is admin interface? |
public | isSite | Is site interface? |
public | login | Login authentication function. |
public | logout | Logout authentication function. |
public | redirect | Redirect to another URL. |
public | render | Render the application. |
public | route | Route the application. |
public | setUserState | Sets the value of a user state variable. |
public | triggerEvent | Calls all handlers associated with an event group. |
public static | getHash | Provides a secure hash based on a seed. |
public static | getInstance | Returns the global object, only creating it if it doesn't already exist. |
public static | getRouter | Returns the application object. |
public static | isWinOS | Method to determine if the host OS is Windows. |
public static | registerEvent | Registers a handler to a particular event group. |
public static | stringURLSafe | This method transliterates a string into an URL safe string or returns a URL safe UTF-8 string based on the global configuration. |
protected | _createConfiguration | Create the configuration registry. |
protected | _createSession | Create the user session. |
- Defined in libraries/joomla/application/application.php
- Extends JObject
Importing[edit]
jimport( 'joomla.application.application' );
See also[edit]
- JApplication source code on BitBucket
- Subpackage Application
- Other versions of JApplication
See Also[edit]
- JApplication on api.joomla.org
- JApplication source code on JoomlaCode
- Subpackage Application
User contributed notes[edit]
Code Examples[edit]