Creating a System Plugin to augment JRouter: Difference between revisions
From Joomla! Documentation
Created page with "From within a plugin, there are 2 ways to get the currently active application context. One is to use the global $app variable: global $app; The other is to use JFactory..." |
m moved Talk:Router Plugins to Talk:Using a System Plugin to augment JRouter: Cleanup |
(No difference)
| |
Revision as of 11:52, 10 April 2012
From within a plugin, there are 2 ways to get the currently active application context. One is to use the global $app variable:
global $app;
The other is to use JFactory to get the application.
$app = JFactory::getApplication('site');
Which is the preferred option?