JApplication: Difference between revisions
From Joomla! Documentation
No edit summary |
m clean up |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
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. | |||
===Defined in=== | ===Defined in=== | ||
| Line 148: | Line 145: | ||
<source lang="php">jimport( 'joomla.application.application' );</source> | <source lang="php">jimport( 'joomla.application.application' );</source> | ||
===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]] | ||
* {{JVer|1.5}} Subpackage Application | |||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=JApplication | category=JApplication | ||
namespace=CodeExample | |||
category=ClassExample | category=ClassExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
Latest revision as of 00:14, 25 March 2017
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.
Defined in
libraries/joomla/application/application.php
Methods
| Method name | Description |
|---|---|
| __construct | Class constructor. |
| getInstance | Returns a reference to the global JApplication object, only creating it if it doesn't already exist. |
| initialise | Initialise the application. |
| route | Route the application. |
| dispatch | Dispatch the applicaiton. |
| render | Render the application. |
| close | Exit the application. |
| redirect | Redirect to another URL. |
| enqueueMessage | Enqueue a system message. |
| getMessageQueue | Get the system message queue. |
| getCfg | |
| getName | Method to get the application name |
| getUserState | Gets a user state. |
| setUserState | Sets the value of a user state variable. |
| getUserStateFromRequest | Gets the value of a user state variable. |
| login | Login authentication function. |
| logout | Logout authentication function. |
| getTemplate | Gets the name of the current template. |
| getRouter | Return a reference to the application JRouter object. |
| getPathway | Return a reference to the application JPathway object. |
| getMenu | Return a reference to the application JPathway object. |
| getClientId | Gets the client id of the current running application. |
| isAdmin | Is admin interface? |
| isSite | Is site interface? |
| appendPathWay | Deprecated functions Deprecated, use JPathWay->addItem() method instead. |
| getCustomPathWay | Deprecated, use JPathway->getPathWayNames() method instead. |
| getHead | Deprecated, use JDocument->get( 'head' ) instead. |
| addMetaTag | Deprecated, use JDocument->setMetaData instead. |
| appendMetaTag | Deprecated, use JDocument->setMetaData instead. |
| prependMetaTag | Deprecated, use JDocument->setMetaData instead |
| addCustomHeadTag | Deprecated, use JDocument->addCustomTag instead (only when document type is HTML). |
| getBlogSectionCount | Deprecated. |
| getBlogCategoryCount | Deprecated. |
| getGlobalBlogSectionCount | Deprecated. |
| getStaticContentCount | Deprecated. |
| getContentItemLinkCount | Deprecated. |
| getPath | Deprecated, use JApplicationHelper::getPath instead. |
| getBasePath | Deprecated, use JURI::base() instead. |
| getUser | Deprecated, use JFactory::getUser instead. |
| getItemid | Deprecated, use ContentHelper::getItemid instead. |
| setPageTitle | Deprecated, use JDocument::setTitle instead. |
| getPageTitle | Deprecated, use JDocument::getTitle instead. |
| registerEvent | Registers a handler to a particular event group. |
| triggerEvent | Calls all handlers associated with an event group. |
Importing
jimport( 'joomla.application.application' );
See Also
JApplication on api.joomla.org
JApplication source code on JoomlaCode
Subpackage Application
Examples
Code Examples