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


PHP sfApplicationConfiguration::getEventDispatcher方法代码示例

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


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

示例1: initialize

 /**
  * Initializes this class.
  *
  * Available options:
  *
  *  * culture:             The culture
  *  * source:              The i18n source (XLIFF by default)
  *  * debug:               Whether to enable debug or not (false by default)
  *  * database:            The database name (default by default)
  *  * untranslated_prefix: The prefix to use when a message is not translated
  *  * untranslated_suffix: The suffix to use when a message is not translated
  *
  * @param sfApplicationConfiguration $configuration   A sfApplicationConfiguration instance
  * @param sfCache                    $cache           A sfCache instance
  * @param array                      $options         An array of options
  */
 public function initialize(sfApplicationConfiguration $configuration, sfCache $cache = null, $options = array())
 {
     $this->configuration = $configuration;
     $this->dispatcher = $configuration->getEventDispatcher();
     $this->cache = $cache;
     if (isset($options['culture'])) {
         $this->setCulture($options['culture']);
         unset($options['culture']);
     }
     $this->options = array_merge(array('source' => 'XLIFF', 'debug' => false, 'database' => 'default', 'untranslated_prefix' => '[T]', 'untranslated_suffix' => '[/T]'), $options);
     $this->dispatcher->connect('user.change_culture', array($this, 'listenToChangeCultureEvent'));
     if ($this->isMessageSourceFileBased($this->options['source'])) {
         $this->dispatcher->connect('controller.change_action', array($this, 'listenToChangeActionEvent'));
     }
 }
开发者ID:sensorsix,项目名称:app,代码行数:31,代码来源:sfI18N.class.php

示例2: initialize

 /**
  * Initializes the current sfContext instance.
  *
  * @param sfApplicationConfiguration $configuration  An sfApplicationConfiguration instance
  */
 public function initialize(sfApplicationConfiguration $configuration)
 {
     $this->configuration = $configuration;
     $this->dispatcher = $configuration->getEventDispatcher();
     try {
         $this->loadFactories();
     } catch (sfException $e) {
         $e->printStackTrace();
     } catch (Exception $e) {
         sfException::createFromException($e)->printStackTrace();
     }
     $this->dispatcher->connect('template.filter_parameters', array($this, 'filterTemplateParameters'));
     // register our shutdown function
     register_shutdown_function(array($this, 'shutdown'));
 }
开发者ID:WIZARDISHUNGRY,项目名称:symfony,代码行数:20,代码来源:sfContext.class.php


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