Example #1
0
 /**
  * @throws \LogicException
  */
 protected static function load()
 {
     $container = parent::load();
     $container['site'] = function ($c) {
         return new Site();
     };
     return $container;
 }
Example #2
0
 /**
  * @throws \LogicException
  */
 protected static function load()
 {
     $container = parent::load();
     $container['site'] = function ($c) {
         return new Site();
     };
     $container['menu'] = function ($c) {
         return new Menu();
     };
     $container['page'] = function ($c) {
         return new Page($c);
     };
     return $container;
 }
Example #3
0
 /**
  * @throws \LogicException
  */
 protected static function load()
 {
     // Make sure Timber plugin has been loaded.
     if (!class_exists('Timber')) {
         throw new \LogicException('Timber not activated. Make sure you activate the plugin in <a href="' . admin_url('plugins.php#timber') . '">' . admin_url('plugins.php') . '</a>');
     }
     $container = parent::load();
     $container['site'] = function ($c) {
         return new Site();
     };
     $container['page'] = function ($c) {
         return new Page($c);
     };
     return $container;
 }
Example #4
0
 /**
  * @throws \LogicException
  */
 protected static function load()
 {
     $container = parent::load();
     $container['site'] = function ($c) {
         return new Site();
     };
     $container['menu'] = function ($c) {
         return new Menu();
     };
     $container['page'] = function ($c) {
         return new Page($c);
     };
     $container['global'] = function ($c) {
         $global = null;
         // Trigger the event.
         $dispatcher = \JEventDispatcher::getInstance();
         $dispatcher->trigger('onGantryGlobalConfig', ['global' => &$global]);
         return $global;
     };
     return $container;
 }
Example #5
0
 /**
  * @param string $location
  * @param bool $force
  * @return array
  */
 public function scripts($location = 'head', $force = false)
 {
     // Do not display head, Joomla will take care of it (most of the time).
     return !$force && $location == 'head' ? [] : parent::scripts($location);
 }