API15

JApplication: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> </span> {{Description:JApplication}} ===Defined in...
 
m clean up
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<span class="editsection" style="font-size:76%;">
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.
<nowiki>[</nowiki>[[Description:JApplication|Edit Descripton]]<nowiki>]</nowiki>
</span>
{{Description:JApplication}}


===Defined in===
===Defined in===
Line 14: Line 11:
|[[API15:JApplication/__construct|__construct]]
|[[API15:JApplication/__construct|__construct]]
|Class constructor.
|Class constructor.
|-
|[[API15:JApplication/getInstance|getInstance]]
|Returns a reference to the global JApplication object, only creating it if it doesn't already exist.
|-
|-
|[[API15:JApplication/initialise|initialise]]
|[[API15:JApplication/initialise|initialise]]
Line 43: Line 43:
|-
|-
|[[API15:JApplication/getName|getName]]
|[[API15:JApplication/getName|getName]]
|Method to get the application name.
|Method to get the application name
|-
|-
|[[API15:JApplication/getUserState|getUserState]]
|[[API15:JApplication/getUserState|getUserState]]
Line 62: Line 62:
|[[API15:JApplication/getTemplate|getTemplate]]
|[[API15:JApplication/getTemplate|getTemplate]]
|Gets the name of the current template.
|Gets the name of the current template.
|-
|[[API15:JApplication/getRouter|getRouter]]
|Return a reference to the application JRouter object.
|-
|-
|[[API15:JApplication/getPathway|getPathway]]
|[[API15:JApplication/getPathway|getPathway]]
|Returns the application JPathway object.
|Return a reference to the application JPathway object.
|-
|-
|[[API15:JApplication/getMenu|getMenu]]
|[[API15:JApplication/getMenu|getMenu]]
|Returns the application JPathway object.
|Return a reference to the application JPathway object.
|-
|-
|[[API15:JApplication/getClientId|getClientId]]
|[[API15:JApplication/getClientId|getClientId]]
Line 78: Line 81:
|Is site interface?
|Is site interface?
|-
|-
|[[API15:JApplication/__toString|__toString]]
|[[API15:JApplication/appendPathWay|appendPathWay]]
|Returns the response
|Deprecated functions Deprecated, use JPathWay-&gt;addItem() method instead.
|-
|[[API15:JApplication/getCustomPathWay|getCustomPathWay]]
|Deprecated, use JPathway-&gt;getPathWayNames() method instead.
|-
|[[API15:JApplication/getHead|getHead]]
|Deprecated, use JDocument-&gt;get( 'head' ) instead.
|-
|[[API15:JApplication/addMetaTag|addMetaTag]]
|Deprecated, use JDocument-&gt;setMetaData instead.
|-
|[[API15:JApplication/appendMetaTag|appendMetaTag]]
|Deprecated, use JDocument-&gt;setMetaData instead.
|-
|[[API15:JApplication/prependMetaTag|prependMetaTag]]
|Deprecated, use JDocument-&gt;setMetaData instead
|-
|[[API15:JApplication/addCustomHeadTag|addCustomHeadTag]]
|Deprecated, use JDocument-&gt;addCustomTag instead (only when document type is HTML).
|-
|[[API15:JApplication/getBlogSectionCount|getBlogSectionCount]]
|Deprecated.
|-
|[[API15:JApplication/getBlogCategoryCount|getBlogCategoryCount]]
|Deprecated.
|-
|[[API15:JApplication/getGlobalBlogSectionCount|getGlobalBlogSectionCount]]
|Deprecated.
|-
|[[API15:JApplication/getStaticContentCount|getStaticContentCount]]
|Deprecated.
|-
|[[API15:JApplication/getContentItemLinkCount|getContentItemLinkCount]]
|Deprecated.
|-
|[[API15:JApplication/getPath|getPath]]
|Deprecated, use JApplicationHelper::getPath instead.
|-
|[[API15:JApplication/getBasePath|getBasePath]]
|Deprecated, use JURI::base() instead.
|-
|-
|[[API15:JApplication/getInstance|getInstance]]
|[[API15:JApplication/getUser|getUser]]
|Returns the global JApplication object, only creating it if it doesn't already exist.
|Deprecated, use JFactory::getUser instead.
|-
|[[API15:JApplication/getItemid|getItemid]]
|Deprecated, use ContentHelper::getItemid instead.
|-
|[[API15:JApplication/setPageTitle|setPageTitle]]
|Deprecated, use JDocument::setTitle instead.
|-
|[[API15:JApplication/getPageTitle|getPageTitle]]
|Deprecated, use JDocument::getTitle instead.
|-
|-
|[[API15:JApplication/registerEvent|registerEvent]]
|[[API15:JApplication/registerEvent|registerEvent]]
Line 89: Line 140:
|[[API15:JApplication/triggerEvent|triggerEvent]]
|[[API15:JApplication/triggerEvent|triggerEvent]]
|Calls all handlers associated with an event group.
|Calls all handlers associated with an event group.
|-
|[[API15:JApplication/getRouter|getRouter]]
|Returns the application JRouter object.
|-
|[[API15: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
|-
|[[API15:JApplication/getHash|getHash]]
|Provides a secure hash based on a seed
|-
|[[API15:JApplication/isWinOS|isWinOS]]
|Method to determine if the host OS is Windows
|}
|}
===Importing===
===Importing===
<source lang="php">jimport( 'joomla.application.application' );</source>
<source lang="php">jimport( 'joomla.application.application' );</source>


<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[SeeAlso:JApplication|Edit See Also]]<nowiki>]</nowiki>
===See Also===
</span>
* {{JVer|1.5}} '''JApplication''' on [https://api.joomla.org/1.5/Joomla-Framework/Application/JApplication.html api.joomla.org]
{{SeeAlso:JApplication}}
* {{JVer|1.5}} '''JApplication source code''' on [[jframework15:application/application.php|JoomlaCode]]
* {{JVer|1.5}} Subpackage Application


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=JApplication
  category=JApplication
  category=CodeExample
  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

Examples

Code Examples