Back to Factory class

Method getApplication

public static \Joomla\CMS\Application\CMSApplicationInterface
getApplication
()
Get the global application object. When the global application doesn't exist, an exception is thrown.
Returns
  • \Joomla\CMS\Application\CMSApplicationInterface object
Since
  • 1.7.0
-
  • \Exception
Class: Factory
Project: Joomla

Method getApplication - Source code

/**
 * Get the global application object. When the global application doesn't exist, an exception is thrown.
 *
 * @return  CMSApplicationInterface object
 *
 * @since   1.7.0
 * @throws  \Exception
 */
public static function getApplication()
{
    if (!self::$application) {
        throw new \Exception('Failed to start application', 500);
    }
    return self::$application;
}
OSZAR »