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


PHP Zend_Controller_Action_HelperBroker::removeHelper方法代码示例

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


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

示例1: preDispatch

    /**
     * Before dispatching the requested controller/action
     * check to see if teh request is an AJAX request (via XMLHTTPREQUEST or $_GET['ajax']
     *
     * If it is an ajax request, remove the layout
     *
     * If it is not, setup the FlashMessenger
     */
    public function preDispatch()
    {
        $this->_initView();
        //if  its an AJAX request stop here - can be simulated via ?ajax GET parameter sent in the request
        if ($this->_request->isXmlHttpRequest() || isset($_GET['ajax'])) {
            Zend_Controller_Action_HelperBroker::removeHelper('Layout');
        }
        /*
        if (!$this->getRequest()->isXmlHttpRequest())
        {
        	$messages = array();
        	$messages['error']   = $this->_helper->FlashMessenger->setNamespace('error')->getMessages();
        	$messages['success'] = $this->_helper->FlashMessenger->setNamespace('success')->getMessages();
        	$this->view->messages = $messages;
        }
        */
        //Sets the base url to the javascripts of the application
        $authNamespace = new Zend_Session_Namespace('Zend_Auth');
        $timeout = $authNamespace->timeout;
        $time_render = time();
        $script = '
			var base_url = "' . $this->view->baseUrl() . '",
                         timeout = "' . $timeout . '",
			 time_render = "' . $time_render . '";
		';
        $this->view->headScript()->prependScript($script, $type = 'text/javascript', $attrs = array());
        $this->view->inlineScript()->appendFile($this->view->baseUrl() . '/js/contadorsessao.js', 'text/javascript');
    }
开发者ID:marcelocaixeta,项目名称:zf1,代码行数:36,代码来源:CustomView.php

示例2: getPresentationAction

 /**
  * Return the presentation file
  */
 protected function getPresentationAction()
 {
     Zend_Controller_Action_HelperBroker::removeHelper('viewRenderer');
     if (!($pres = $this->getD2EM()->getRepository('\\Entities\\MeetingItem')->find($this->getParam('id', null)))) {
         $this->addMessage('The requested presentation does not exist or does not have an associated file attached to it.', OSS_Message::ERROR);
         $this->redirect('meeting/read');
     }
     $fn = "IXP_Members_Meeting_{$pres->getMeeting()->getDate()->format('Y-m-d')}_({$pres->getId()}).";
     // What kind of file do we have?
     if (preg_match('/pdf$/i', $pres->getFilename())) {
         header('Content-type: application/pdf');
         $fn .= 'pdf';
     } else {
         if (preg_match('/ppt$/i', $pres->getFilename())) {
             header('Content-type: application/vnd.ms-powerpoint');
             $fn .= 'ppt';
         } else {
             if (preg_match('/pps$/i', $pres->getFilename())) {
                 header('Content-type: application/vnd.ms-powerpoint');
                 $fn .= 'pps';
             } else {
                 if (preg_match('/pptx$/i', $pres->getFilename())) {
                     header('Content-type: application/vnd.ms-powerpoint');
                     $fn .= 'pptx';
                 } else {
                     header('Content-type: application/octet-stream');
                     $fn .= substr($pres->getFilename(), strrpos($pres->getFilename(), '.'));
                 }
             }
         }
     }
     header('Content-Disposition: attachment; filename="' . $fn . '"');
     echo @file_get_contents(self::getMeetingsDirectory() . DIRECTORY_SEPARATOR . $pres->getMeeting()->getId() . DIRECTORY_SEPARATOR . $pres->getPresentation());
 }
开发者ID:E-Poludnie,项目名称:IXP-Manager,代码行数:37,代码来源:MeetingItemController.php

示例3: errorAction

 /**
  * The default error handler action
  */
 public function errorAction()
 {
     $this->getLogger()->debug("\n");
     $this->getLogger()->debug('ErrorController::errorAction()');
     $log = "\n\n************************************************************************\n" . "****************************** EXCEPTIONS *******************************\n" . "************************************************************************\n\n";
     $exceptions = $this->getResponse()->getException();
     if (is_array($exceptions)) {
         foreach ($exceptions as $e) {
             $log .= "--------------------------- EXCEPTION --------------------------\n\n" . "Message: " . $e->getMessage() . "\nLine: " . $e->getLine() . "\nFile: " . $e->getFile();
             $log .= "\n\nTrace:\n\n" . $e->getTraceAsString() . "\n\n" . print_r(OSS_Debug::compact_debug_backtrace(), true) . "\n\n";
         }
     }
     $log .= "------------------------\n\n" . "HTTP_HOST : {$_SERVER['HTTP_HOST']}\n" . "HTTP_USER_AGENT: {$_SERVER['HTTP_USER_AGENT']}\n" . (isset($_SERVER['HTTP_COOKIE']) ? "HTTP_COOKIE: {$_SERVER['HTTP_COOKIE']}\n" : "") . "REMOTE_PORT: {$_SERVER['REMOTE_PORT']}\n" . "REQUEST_METHOD: {$_SERVER['REQUEST_METHOD']}\n" . "REQUEST_URI: {$_SERVER['REQUEST_URI']}\n\n";
     $this->getResponse()->setBody('OK: 0');
     if (isset($this->view)) {
         if ($errors = $this->_getParam('error_handler', false)) {
             $this->getResponse()->clearBody();
             switch ($errors->type) {
                 case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
                 case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
                     // 404 error -- controller or action not found
                     $this->getResponse()->setRawHeader('HTTP/1.1 404 Not Found');
                     Zend_Controller_Action_HelperBroker::removeHelper('viewRenderer');
                     $this->view->display('error/error-404.phtml');
                     $this->getLogger()->debug($log);
                     break;
                 default:
                     $this->getLogger()->err($log);
                     $this->view->exceptions = $exceptions;
                     break;
             }
         }
     }
     return true;
 }
开发者ID:opensolutions,项目名称:oss-framework,代码行数:38,代码来源:Error.php

示例4: OSS_Controller_Action_Trait_Smarty_Init

 /**
  * The trait's initialisation method.
  *
  * This function is called from the Action's contructor and it passes those
  * same variables used for construction to the traits' init methods.
  *
  * @param object $request See Parent class constructor
  * @param object $response See Parent class constructor
  * @param object $invokeArgs See Parent class constructor
  */
 public function OSS_Controller_Action_Trait_Smarty_Init($request, $response, $invokeArgs)
 {
     $this->view = $this->createView();
     if ($this->traitIsInitialised('OSS_Controller_Action_Trait_Namespace')) {
         $this->view->session = $this->getSessionNamespace();
     }
     $this->view->options = $this->_options;
     $this->view->addHelperPath('OSS/View/Helper', 'OSS_View_Helper');
     $this->view->module = $this->getRequest()->getModuleName();
     $this->view->controller = $this->getRequest()->getControllerName();
     $this->view->action = $this->getRequest()->getActionName();
     $this->view->basepath = Zend_Controller_Front::getInstance()->getBaseUrl();
     $this->view->getEngine()->loadFilter("pre", 'whitespace_control');
     if (substr($request->getActionName(), 0, 4) == 'ajax' || substr($request->getActionName(), 0, 3) == 'cli') {
         Zend_Controller_Action_HelperBroker::removeHelper('viewRenderer');
     } else {
         $this->view->doctype('HTML5');
         $this->view->headMeta()->appendHttpEquiv('Content-Type', 'text/html;charset=utf-8');
     }
     if ($this->traitIsInitialised('OSS_Controller_Action_Trait_Auth')) {
         $this->view->auth = $this->getAuth();
         $this->view->hasIdentity = $this->getAuth()->hasIdentity();
         $this->view->identity = $this->getIdentity();
         if ($this->getAuth()->hasIdentity() && method_exists($this, 'getUser')) {
             $this->view->user = $this->getUser();
         }
     }
     $this->traitSetInitialised('OSS_Controller_Action_Trait_Smarty');
 }
开发者ID:opensolutions,项目名称:oss-framework,代码行数:39,代码来源:Smarty.php

示例5: preDispatch

 public function preDispatch()
 {
     // there's no HTML output from this controller - just images
     Zend_Controller_Action_HelperBroker::removeHelper('viewRenderer');
     header('Content-Type: image/png');
     header('Expires: Thu, 01 Jan 1970 00:00:00 GMT');
 }
开发者ID:E-Poludnie,项目名称:IXP-Manager,代码行数:7,代码来源:MrtgController.php

示例6: preDispatch

 /**
  * Предиспетчер
  * 
  * @return void
  */
 public function preDispatch()
 {
     $this->_jsdir = DOCUMENT_PATH . '/js/';
     $this->_cssdir = DOCUMENT_PATH . '/css/';
     $this->_cache = $this->_boot->getPluginResource('Cachemanager')->getCacheManager()->getCache('files');
     Zend_Controller_Action_HelperBroker::removeHelper('viewRenderer');
 }
开发者ID:ei-grad,项目名称:phorm,代码行数:12,代码来源:Minify.php

示例7: setUp

 public function setUp()
 {
     $front = Zend_Controller_Front::getInstance();
     $front->resetInstance();
     $front->setControllerDirectory(array('default' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '_files', 'admin' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'Admin'));
     Zend_Controller_Action_HelperBroker::removeHelper('viewRenderer');
     $this->_dispatcher = new Zend_Controller_Dispatcher_Standard();
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:8,代码来源:StandardTest.php

示例8: testLoadingAndRemovingHelpersStatically

 public function testLoadingAndRemovingHelpersStatically()
 {
     $helper = new Zend_Controller_Action_Helper_Redirector();
     Zend_Controller_Action_HelperBroker::addHelper($helper);
     $this->assertTrue(Zend_Controller_Action_HelperBroker::hasHelper('redirector'));
     Zend_Controller_Action_HelperBroker::removeHelper('redirector');
     $this->assertFalse(Zend_Controller_Action_HelperBroker::hasHelper('redirector'));
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:8,代码来源:HelperBrokerTest.php

示例9: dispatch

 public function dispatch($url = null)
 {
     // removing this helper solves issues with multiple redirects in one test
     // a fresh instance of helper is registered anyway
     Zend_Controller_Action_HelperBroker::removeHelper('redirector');
     //         Zend_Controller_Action_HelperBroker::removeHelper('flashMessenger');
     parent::dispatch($url);
 }
开发者ID:lukaszjankowski,项目名称:alchemy,代码行数:8,代码来源:ControllerTestCase.php

示例10: tearDown

 /**
  * See {@link PHPUnit_Framework_TestCase::tearDown()} for details.
  */
 protected function tearDown()
 {
     foreach ($this->helpersToRemove as $name) {
         /* @var $name string */
         Zend_Controller_Action_HelperBroker::removeHelper($name);
     }
     parent::tearDown();
 }
开发者ID:matthimatiker,项目名称:molcomponents,代码行数:11,代码来源:WebControllerTestCaseExternalTest.php

示例11: euroixExportAction

 public function euroixExportAction()
 {
     Zend_Controller_Action_HelperBroker::removeHelper('viewRenderer');
     $customers = $this->getD2EM()->getRepository('\\Entities\\Customer')->getCurrentActive(false, $this->getParam('trafficing', true) ? true : false, $this->getParam('externalonly', true) ? true : false, is_int($this->getParam('ixp', false)) ? $this->getParam('ixp', false) : false);
     $this->getResponse()->setHeader('Content-Type', 'text/plain');
     foreach ($customers as $c) {
         echo sprintf("%s;%s;%s;%s\n", str_replace(';', '-', $c->getName()), $c->getAutsys(), $c->getCorpwww(), $c->isIPvXEnabled(6) ? 'Yes' : 'No');
     }
 }
开发者ID:E-Poludnie,项目名称:IXP-Manager,代码行数:9,代码来源:CustomerController.php

示例12: preDispatch

 public function preDispatch()
 {
     $this->assertUserPriv(\Entities\User::AUTH_SUPERUSER);
     Zend_Controller_Action_HelperBroker::removeHelper('viewRenderer');
     // typically a module uses its own views/ folder - but we're sharing these
     // templates with the main / default module for the CLI actions so we'll
     // point it there instead
     $this->getView()->setScriptPath(APPLICATION_PATH . '/views');
 }
开发者ID:E-Poludnie,项目名称:IXP-Manager,代码行数:9,代码来源:RouterController.php

示例13: preDispatch

 /**
  * (non-PHPdoc)
  * @see Zend_Controller_Action::preDispatch()
  */
 public function preDispatch()
 {
     $this->view->addHelperPath('App' . DS . 'View' . DS . 'Helper', 'App_View_Helper');
     $this->_helper->addPath('App' . DS . 'Controller' . DS . 'Action' . DS . 'Helper', 'App_Controller_Action_Helper_');
     //if  its an AJAX request stop here
     if ($this->isAjaxRequest()) {
         Zend_Controller_Action_HelperBroker::removeHelper('Layout');
     }
 }
开发者ID:visualweber,项目名称:appzf1,代码行数:13,代码来源:Action.php

示例14: _defineResponseContexts

 /**
  * Run the response_contexts filter.
  *
  * @return void
  */
 protected function _defineResponseContexts()
 {
     Zend_Controller_Action_HelperBroker::removeHelper('contextSwitch');
     Zend_Controller_Action_HelperBroker::addHelper(new Omeka_Controller_Action_Helper_ContextSwitch());
     $contexts = Zend_Controller_Action_HelperBroker::getStaticHelper('contextSwitch');
     $contexts->setContextParam('output');
     $contextArray = Omeka_Application_Resource_Helpers::getDefaultResponseContexts();
     $contextArray = $this->pluginBroker->applyFilters('response_contexts', $contextArray);
     $contexts->addContexts($contextArray);
 }
开发者ID:lchen01,项目名称:STEdwards,代码行数:15,代码来源:Plugin.php

示例15: routeStartup

 public function routeStartup(Zend_Controller_Request_Abstract $request)
 {
     $request->setParam('View', Showcase_View_Smarty::factory('view.xml'));
     $request->getParam('View')->cache_handler_func = 'zend_cache_handler';
     $request->getParam('View')->caching = 0;
     $viewRenderer = new Showcase_Controller_Action_Helper_ViewRenderer();
     $viewRenderer->setViewSuffix('tpl')->setView($request->getParam('View'))->setViewBasePathSpec(Package::buildPath(SITE_DIR, 'views'));
     Zend_Controller_Action_HelperBroker::removeHelper('viewRenderer');
     Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
 }
开发者ID:roycocup,项目名称:Tests,代码行数:10,代码来源:View.php


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