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


PHP Zend_Controller_Front::registerPlugin方法代码示例

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


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

示例1: testConstructorUsesExistingPluginWhenPresent

 public function testConstructorUsesExistingPluginWhenPresent()
 {
     $plugin = new \Zend\Controller\Plugin\ActionStack();
     $this->front->registerPlugin($plugin);
     $helper = new Helper\ActionStack();
     $this->assertTrue($this->front->hasPlugin('Zend\\Controller\\Plugin\\ActionStack'));
     $registered = $this->front->getPlugin('Zend\\Controller\\Plugin\\ActionStack');
     $this->assertSame($plugin, $registered);
 }
开发者ID:bradley-holt,项目名称:zf2,代码行数:9,代码来源:ActionStackTest.php

示例2: _initPlugins

 /**
  * init plugins
  * @return void
  */
 protected function _initPlugins()
 {
     # only embed the debugging plugin if application status is development or testing
     if ($this->applicationStatus == "development") {
         # embed the ZFDebug Plugin/console
         $debug = new ZFDebug_Controller_Plugin_Debug(array('jquery_path' => '', 'plugins' => array('Variables', 'File' => array('basePath' => APPLICATION_PATH), 'Memory', 'Time', 'Html', 'Exception')));
         $this->frontController->registerPlugin($debug);
     }
     # init error handler
     $this->frontController->throwExceptions(false);
     $errorhandler = new Zend_Controller_Plugin_ErrorHandler();
     $errorhandler->setErrorHandler(array('module' => 'cms', 'controller' => 'error', 'action' => 'error'));
     $this->frontController->registerPlugin($errorhandler);
     # gadget plugin
     $gadgetPlugin = new FansubCMS_Controller_Plugin_Gadget();
     $this->frontController->registerPlugin($gadgetPlugin);
     # not-logged-in-so-go-to-login plugin
     $aclPlugin = new FansubCMS_Controller_Plugin_Acl(Zend_Auth::getInstance()->setStorage(new FansubCMS_Auth_Storage_DoctrineSession()));
     $this->frontController->registerPlugin($aclPlugin);
     # check if install or update is needed
     $installPlugin = new FansubCMS_Controller_Plugin_InstallCheck();
     $this->frontController->registerPlugin($installPlugin);
     # the navigation plugin
     $navPlugin = new FansubCMS_Controller_Plugin_Navigation();
     $this->frontController->registerPlugin($navPlugin);
 }
开发者ID:KasaiDot,项目名称:FansubCMS,代码行数:30,代码来源:Bootstrap.php

示例3: initPlugins

 /**
  * Initialize plugins
  *
  * @return void
  */
 public function initPlugins()
 {
     $this->_front->registerPlugin(new UGD_Login_Plugin());
     $layoutController = new Util_Layout();
     $layoutController->registerModuleLayout('admin', $this->_root . '/application/admin/layouts', 'admin');
     $this->_front->registerPlugin($layoutController, -999);
 }
开发者ID:rdohms,项目名称:ugDirectory,代码行数:12,代码来源:Initializer.php

示例4: testUsingFrontController

 public function testUsingFrontController()
 {
     $controller = new Zend_Controller_Front();
     $controller->setControllerDirectory(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . '_files');
     $request = new Zend_Controller_Request_Http('http://framework.zend.com/empty');
     $controller->setResponse(new Zend_Controller_Response_Cli());
     $controller->setRouter(new Zend_Controller_Router());
     $plugin = new Zend_Controller_Plugin_BrokerTest_TestPlugin();
     $controller->registerPlugin($plugin);
     $response = $controller->dispatch($request);
     $this->assertEquals('123456', $response->getBody());
     $this->assertEquals('123456', $plugin->getResponse()->getBody());
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:13,代码来源:BrokerTest.php

示例5: run

 public function run()
 {
     $this->init();
     foreach ($this->config['plugins'] as $name => $config) {
         include_once $name . '.php';
         $plugin = new $name($config);
         $this->frontController->registerPlugin($plugin);
     }
     try {
         $__start = getmicrotime();
         $this->frontController->dispatch();
         za()->recordStat('za::dispatch', getmicrotime() - $__start);
     } catch (Exception $e) {
         // record the current _GET and _POST variables
         $this->logger->err("Dispatch failed for " . current_url() . ": " . $e->getMessage() . ", get and post to follow");
         $this->logger->err(print_r($_REQUEST, true));
         throw $e;
     }
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:19,代码来源:NovemberApplication.php

示例6: registerFriendlyurlsPlugin

 public function registerFriendlyurlsPlugin()
 {
     $this->frontController->registerPlugin(new Sydney_Controller_Plugin_Friendlyurls());
 }
开发者ID:Cryde,项目名称:sydney-core,代码行数:4,代码来源:Bootstrapper.php

示例7: initPlugins

 /**
  * Initialize plugins 
  * 
  * @return void
  */
 public function initPlugins()
 {
     /* Modular Models Directory plugin */
     $this->_front->registerPlugin(new ModularModelsDirectory());
 }
开发者ID:neffers,项目名称:Nefcraft,代码行数:10,代码来源:Initializer.php

示例8: initPlugins

 /**
  * Initialize plugins
  *
  * @return void
  */
 public function initPlugins()
 {
     $this->_front->registerPlugin(new ZFB_Controller_Plugin_ViewSetup());
     $this->_front->registerPlugin(new ZFB_Controller_Plugin_ActionStack());
 }
开发者ID:kruppi,项目名称:zfblog,代码行数:10,代码来源:Initializer.php


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