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


PHP Yaf_Dispatcher::registerPlugin方法代码示例

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


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

示例1: LoginPlugin

 function _initPlugin(Yaf_Dispatcher $dispatcher)
 {
     Yaf_Loader::import('vendor/autoload.php');
     $dispatcher->registerPlugin(new Plugin_Init());
     $dispatcher->registerPlugin(new Plugin_Smarty());
     $dispatcher->registerPlugin(new LoginPlugin());
 }
开发者ID:Zjmainstay,项目名称:php-doc-management,代码行数:7,代码来源:Bootstrap.php

示例2: _initPlugin

 public function _initPlugin(Yaf_Dispatcher $dispatcher)
 {
     $router = new RouterPlugin();
     $dispatcher->registerPlugin($router);
     $admin = new AdminPlugin();
     $dispatcher->registerPlugin($admin);
     Yaf_Registry::set('adminPlugin', $admin);
 }
开发者ID:xinuxZ,项目名称:YOF,代码行数:8,代码来源:Bootstrap.php

示例3: _initPlugin

 public function _initPlugin(\Yaf_Dispatcher $dispatcher)
 {
     /*{{{*/
     // 初始化模版引擎 twig
     $Twig = new TwigPlugin();
     $dispatcher->registerPlugin($Twig);
     if ($this->config['xhprof']['open']) {
         $xhprof = new xhprofPlugin();
         $dispatcher->registerPlugin($xhprof);
     }
 }
开发者ID:haobojunsun,项目名称:d3,代码行数:11,代码来源:Bootstrap.php

示例4: _initPlugin

 public function _initPlugin(Yaf_Dispatcher $dispatcher)
 {
     if (isset($this->config->application->benchmark) && $this->config->application->benchmark == true) {
         $benchmark = new BenchmarkPlugin();
         $dispatcher->registerPlugin($benchmark);
     }
     //cookie涉及HTTP请求,命令行下应禁用
     if (REQUEST_METHOD != 'CLI') {
         $cookie = new CookiePlugin();
         $dispatcher->registerPlugin($cookie);
     }
 }
开发者ID:liu33851861,项目名称:CZD_Yaf_Extension,代码行数:12,代码来源:Bootstrap.php

示例5: initYafBySooh

 /**
  * 
  * @param \Yaf_Dispatcher $dispatcher
  * @param  string $jqueryVer 使用的jquery文件,默认值:jquery-1.11.2.min.js
  * @return view
  */
 public static function initYafBySooh($dispatcher, $jqueryVer = 'jquery-1.11.2.min.js')
 {
     $router = $dispatcher->getRouter();
     $router->addRoute("byVar", new \Yaf_Route_Supervar(SOOH_ROUTE_VAR));
     \Yaf_Loader::getInstance()->registerLocalNameSpace($GLOBALS['CONF']['localLibs']);
     $req = $dispatcher->getRequest();
     $tmp = $req->get('__ONLY__');
     if ($tmp == 'body') {
         \SoohYaf\Viewext::$bodyonly = true;
     }
     $tmp = trim($req->get('__VIEW__'));
     //html(default),wap,  json
     define('VIW_INC_PATH', APP_PATH . '/application/views/_inc/');
     \SoohYaf\Viewext::$jqueryVer = $jqueryVer;
     if (!empty($tmp)) {
         $tmp = strtolower($tmp);
         \Sooh\Base\Ini::getInstance()->viewRenderType($tmp);
         if ($tmp == 'jsonp') {
             \Sooh\Base\Ini::getInstance()->initGobal(array('nameJsonP' => $req->get('jsonp', 'jsonp')));
         }
     }
     //		$tmp = $dispatcher->getRequest()->get('__GZIP__');
     //		if(!empty($tmp)){
     //			$tmp = strtolower ($tmp);
     //			if($tmp=='gzip')define("ZIP_OUTPUT",$tmp);
     //		}
     $view = new \SoohYaf\Viewext(null);
     $dispatcher->setView($view);
     $dispatcher->registerPlugin(new SoohPlugin());
     return $view;
 }
开发者ID:hillstill,项目名称:soohyaf,代码行数:37,代码来源:SoohPlugin.php

示例6: _initPlugin

 public function _initPlugin(\Yaf_Dispatcher $dispatcher)
 {
     /*{{{*/
     // 初始化模版引擎 twig
     $Twig = new TwigPlugin();
     $dispatcher->registerPlugin($Twig);
 }
开发者ID:xujunjiepk,项目名称:yaf_base,代码行数:7,代码来源:Bootstrap.php

示例7: _init

 public function _init(Yaf_Dispatcher $dispatcher)
 {
     // auto start session
     Yaf_Session::getInstance()->start();
     // auto load config data
     $this->config = Yaf_Application::app()->getConfig();
     Yaf_Registry::set('Config', $this->config);
     //auto load redis
     $redis = new Redis();
     $redis->connect($this->config->redis->host, $this->config->redis->port, $this->config->redis->timeout, $this->config->redis->reserved, $this->config->redis->interval);
     Yaf_Registry::set('Redis', $redis);
     //auto load mysql
     Yaf_Registry::set('DbRead', new Db('mysql:host=' . $this->config->mysql->read->host . ';dbname=' . $this->config->mysql->read->dbname . ';charset=' . $this->config->mysql->read->charset . ';port=' . $this->config->mysql->read->port . '', $this->config->mysql->read->username, $this->config->mysql->read->password));
     Yaf_Registry::set('DbWrite', new Db('mysql:host=' . $this->config->mysql->write->host . ';dbname=' . $this->config->mysql->write->dbname . ';charset=' . $this->config->mysql->write->charset . ';port=' . $this->config->mysql->write->port . '', $this->config->mysql->write->username, $this->config->mysql->write->password));
     // auto load model
     Yaf_Registry::set('I18n', new I18nModel($redis, $this->config->application->name, 'cn'));
     Yaf_Registry::set('Cache', new CacheModel($redis, $this->config->application->name));
     // auto load plugin
     $dispatcher->registerPlugin(new GlobalPlugin());
     // auto save request
     $request = $dispatcher->getRequest();
     // auto set ajax is no render
     if ($request->isXmlHttpRequest()) {
         $dispatcher->autoRender(false);
     }
     // auto set http protocol to action except http get protocol
     if (!$request->isGet()) {
         $dispatcher->setDefaultAction($request->getMethod());
     }
 }
开发者ID:a707937337,项目名称:helloword,代码行数:30,代码来源:Bootstrap.php

示例8: _initPlugin

 /**
  * 初始化plugin(插件)
  */
 public function _initPlugin(Yaf_Dispatcher $dispatcher)
 {
     //注册xhprof插件
     if (isset($this->_config->application->xhprof) && $this->_config->application->xhprof) {
         $XHProf = new XHProfPlugin();
         $dispatcher->registerPlugin($XHProf);
     }
 }
开发者ID:RamboLau,项目名称:yaf.framework,代码行数:11,代码来源:Bootstrap.php

示例9: _initPlugin

 public function _initPlugin(Yaf_Dispatcher $dispatcher)
 {
     //echo 'aaa';
     //include (APP_PATH.'/plugins/UserPlugin.php');
     $user = new UserPlugin();
     //        echo 'cccc';
     $dispatcher->registerPlugin($user);
     //echo 'fff';
 }
开发者ID:phpcandy,项目名称:phpcandy.github.io,代码行数:9,代码来源:bootstrap.php

示例10: _initLayout

 public function _initLayout(Yaf_Dispatcher $dispatcher)
 {
     /*layout allows boilerplate HTML to live in /views/layout rather than every script*/
     $layout = new LayoutPlugin('layout.phtml');
     /* Store a reference in the registry so values can be set later.
      * This is a hack to make up for the lack of a getPlugin
      * method in the dispatcher.
      */
     Yaf_Registry::set('layout', $layout);
     /*add the plugin to the dispatcher*/
     $dispatcher->registerPlugin($layout);
 }
开发者ID:haokee,项目名称:Yaf-PHP-Example,代码行数:12,代码来源:Bootstrap.php

示例11: define

 /**
  * 采用布局
  * @param Yaf_Dispatcher $dispatcher
  */
 function _initLayout(Yaf_Dispatcher $dispatcher)
 {
     define('REDIRECT_URL', empty($_SERVER['REQUEST_URI']) ? '/' : strtolower($_SERVER['REQUEST_URI']));
     # 用户后台
     if (false !== strpos(REDIRECT_URL, '/user_emailverify')) {
         return;
     }
     if (false !== strpos(REDIRECT_URL, '/user_') || false !== strpos(REDIRECT_URL, '/huodong_') || false !== strpos(REDIRECT_URL, '/loan_')) {
         $layout = new LayoutPlugin('user/tpl.layout.phtml');
         Yaf_Registry::set('layout', $layout);
         $dispatcher->registerPlugin($layout);
     }
 }
开发者ID:tanqinwang,项目名称:test_own,代码行数:17,代码来源:Bootstrap.php

示例12: _initPlugin

 public function _initPlugin(Yaf_Dispatcher $dispatcher)
 {
     //注册一个插件
     $systemPlugin = new SystemPlugin();
     $dispatcher->registerPlugin($systemPlugin);
 }
开发者ID:write123,项目名称:zyjdSrv,代码行数:6,代码来源:Bootstrap.php

示例13: _initPlugin

 /**
  * plug config
  */
 public function _initPlugin(Yaf_Dispatcher $dispatcher)
 {
     $routerPlugin = new RouterPlugin();
     $dispatcher->registerPlugin($routerPlugin);
 }
开发者ID:xiaoyueer98,项目名称:app.heimi.com,代码行数:8,代码来源:Bootstrap.php

示例14: _initPlugins

 /**
  * 初始化插件
  */
 public function _initPlugins(Yaf_Dispatcher $dispatcher)
 {
     $global = new GlobalPlugin();
     $dispatcher->registerPlugin($global);
 }
开发者ID:xiaofang520,项目名称:agency,代码行数:8,代码来源:Bootstrap.php

示例15: _initPlugin

 /**
  * 注册一个插件
  * 插件的目录是在application_directory/plugins
  */
 public function _initPlugin(Yaf_Dispatcher $dispatcher)
 {
     $user = new UserPlugin();
     $dispatcher->registerPlugin($user);
 }
开发者ID:wangfakang,项目名称:yaf-1,代码行数:9,代码来源:plugin.php


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