Example #1
0
 /**
  * Caches menus
  *
  * @param string  $hook   name of the hook
  * @param string  $type   type of the hook
  * @param unknown $return return value
  * @param unknown $params hook parameters
  *
  * @return void
  */
 public static function viewMenu($hook, $type, $return, $params)
 {
     if (elgg_in_context('admin')) {
         return;
     }
     $menu = new \ColdTrick\MenuBuilder\Menu($params['vars']['name']);
     $menu->saveToCache($return);
 }