本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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());
}
示例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;
}
}
示例6: registerFriendlyurlsPlugin
public function registerFriendlyurlsPlugin()
{
$this->frontController->registerPlugin(new Sydney_Controller_Plugin_Friendlyurls());
}
示例7: initPlugins
/**
* Initialize plugins
*
* @return void
*/
public function initPlugins()
{
/* Modular Models Directory plugin */
$this->_front->registerPlugin(new ModularModelsDirectory());
}
示例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());
}