当前位置: 首页>>代码示例>>PHP>>正文


PHP ExceptionHandler::skipMenus方法代码示例

本文整理汇总了PHP中ExceptionHandler::skipMenus方法的典型用法代码示例。如果您正苦于以下问题:PHP ExceptionHandler::skipMenus方法的具体用法?PHP ExceptionHandler::skipMenus怎么用?PHP ExceptionHandler::skipMenus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ExceptionHandler的用法示例。


在下文中一共展示了ExceptionHandler::skipMenus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Constructor that will create a Smarty object and configure it according
  * to what's been specified in config.inc.
  */
 public function __construct()
 {
     /* Create a Smarty object. */
     $this->_smarty = new Smarty();
     # Stick it globally so we could refer the translations
     global $Smarty;
     $Smarty = $this->_smarty;
     global $lang;
     global $available_languages;
     /* Configure smarty. */
     $this->_smarty->compile_dir = SMARTY_DIR_COMPILE;
     $this->_smarty->cache_dir = SMARTY_DIR_CACHE;
     $this->_smarty->config_dir = SMARTY_DIR_CONFIG;
     $this->_smarty->request_use_auto_globals = SMARTY_USE_GLOBALS;
     $this->_smarty->caching = SMARTY_CACHING_ENABLE;
     $this->_smarty->cache_lifetime = SMARTY_CACHING_LIFETIME;
     $this->_smarty->compile_check = SMARTY_CACHING_COMPILE_CHECK;
     $this->_smarty->force_recheck = SMARTY_CACHING_FORCE_RECHECK;
     $this->_smarty->template_dir = array("templates_{$lang}", 'templates');
     $this->_smarty->compile_id = $lang;
     $this->_smarty->config_dir = ".";
     # First we read English, so al defaults are there
     $this->_smarty->config_load(DIR_LANG . "/lang.ini");
     # Now we try to read translations
     if (is_file($fname = DIR_LANG . "/lang.{$lang}.ini") && is_readable($fname)) {
         $this->_smarty->config_load($fname);
     }
     setlocale(LC_TIME, $Smarty->_config[0]['vars']['locale']);
     /**
      * Add a output-filter to make sure ampersands are properly encoded to
      * HTML-entities.
      */
     $this->_smarty->register_outputfilter(array(&$this, 'outputFilter'));
     /* Give Smarty-template access to date(). */
     $this->_smarty->register_modifier('date_f', array(&$this, 'date_f'));
     $this->_smarty->register_modifier('date_localized', array(&$this, 'date_localized'));
     /* Give Smarty-templates access to the ampersandEntity() function. */
     $this->_smarty->register_modifier('escapeAmpersand', array(&$this, 'ampersandEntity'));
     $this->_title = '';
     $this->_css_files = array();
     $this->_js_files = array();
     $this->_show_intro = false;
     $this->_content_title = '';
     $this->_content = '';
     /* The menus have caused an exception, need to skip them. */
     if (!ExceptionHandler::skipMenus()) {
         $menus = MenuModel::getAllMenus();
     }
     # Construct lang URL
     $pageurl = preg_replace('/\\?lang=[a-z]*$/', '', $_SERVER['REQUEST_URI']);
     /* Set up the common variables before displaying. */
     $vars = array('release' => RELEASE, 'baseurl' => URL_BASE, 'heroes_num' => HEROES_NUM, 'menus' => $menus, 'pageurl' => $pageurl, 'available_languages' => $available_languages);
     $this->_smarty->assign($vars);
 }
开发者ID:rootfather,项目名称:scummvm-web,代码行数:58,代码来源:Controller.php

示例2: __construct

 /**
  * Constructor that will create a Smarty object and configure it according
  * to what's been specified in config.inc.
  */
 public function __construct()
 {
     /* Create a Smarty object. */
     $this->_smarty = new Smarty();
     /* Configure smarty. */
     $this->_smarty->template_dir = SMARTY_DIR_TEMPLATE;
     $this->_smarty->compile_dir = SMARTY_DIR_COMPILE;
     $this->_smarty->cache_dir = SMARTY_DIR_CACHE;
     $this->_smarty->config_dir = SMARTY_DIR_CONFIG;
     $this->_smarty->request_use_auto_globals = SMARTY_USE_GLOBALS;
     $this->_smarty->caching = SMARTY_CACHING_ENABLE;
     $this->_smarty->cache_lifetime = SMARTY_CACHING_LIFETIME;
     $this->_smarty->compile_check = SMARTY_CACHING_COMPILE_CHECK;
     $this->_smarty->force_recheck = SMARTY_CACHING_FORCE_RECHECK;
     /**
      * Add a output-filter to make sure ampersands are properly encoded to
      * HTML-entities.
      */
     $this->_smarty->register_outputfilter(array(&$this, 'outputFilter'));
     /* Give Smarty-template access to date(). */
     $this->_smarty->register_modifier('date_f', array(&$this, 'date_f'));
     /* Give Smarty-templates access to the ampersandEntity() function. */
     $this->_smarty->register_modifier('escapeAmpersand', array(&$this, 'ampersandEntity'));
     $this->_title = '';
     $this->_css_files = array();
     $this->_js_files = array();
     $this->_show_intro = false;
     $this->_content_title = '';
     $this->_content = '';
     /* The menus have caused an exception, need to skip them. */
     if (!ExceptionHandler::skipMenus()) {
         $menus = MenuModel::getAllMenus();
     }
     /* Set up the common variables before displaying. */
     $vars = array('release' => RELEASE, 'baseurl' => URL_BASE, 'heroes_num' => HEROES_NUM, 'menus' => $menus);
     $this->_smarty->assign($vars);
 }
开发者ID:bgK,项目名称:scummvm-web,代码行数:41,代码来源:Controller.php


注:本文中的ExceptionHandler::skipMenus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。