J2.5 talk

J2.5 talk:Creating a System Plugin to augment JRouter

From Joomla! Documentation

Revision as of 11:47, 10 April 2012 by Garyamort (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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?