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


PHP Zend_Controller_Action::__construct方法代码示例

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


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

示例1: __construct

 public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
 {
     parent::__construct($request, $response, $invokeArgs);
     $this->_controller = $this->getRequest()->getControllerName();
     if ($this->_controller != "message") {
         /* Maikon.Will - Correção de bug - 14/06/2012
          * 
          * O nome do controller vem em minusculo (Ex: treatment)
          * Como o windows não é totalmente case sensitivity
          * não ocorre erro nenhum, mas rodando em ambientes Unix,
          * um ambiente full case sensitivity por padrão, ele não encontrará
          * nem o modulo, nem nenhum controler e nenhum respectivo arquivo a este modulo
          * pois o nome definido como padrão no produto sempre será Ex: TreatmentForm.php
          * 
          * Antes:
          * $form = $this->_controller."Form";
          * $model = $this->_controller."Model";
          */
         $controller = ucfirst($this->_controller);
         $form = $controller . "Form";
         $model = $controller . "Model";
         /** Ajuste: Deve ser feita validação para quando não existe form e model; */
         $this->_form = new $form();
         $this->_model = new $model();
     }
 }
开发者ID:robertsonmello,项目名称:projetos,代码行数:26,代码来源:WindowAbstractController.php

示例2: __construct

    public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
    {
        parent::__construct($request, $response, $invokeArgs);

        $this->_auth = Zend_Auth::getInstance();
        $this->_config = Zend_Registry::get('config');
    }
开发者ID:nidorx,项目名称:Zend_Dao_Vo,代码行数:7,代码来源:Action.php

示例3: __construct

 public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
 {
     parent::__construct($request, $response, $invokeArgs);
     date_default_timezone_set(DATE_ZONE);
     Logger::configure(LOG_ERROR);
     $this->_logger = Logger::getLogger(__CLASS__);
 }
开发者ID:jquedena,项目名称:explora-titania,代码行数:7,代码来源:ErrorController.php

示例4: __construct

 /**
  * Class constructor
  *
  * The request and response objects should be registered with the
  * controller, as should be any additional optional arguments; these will be
  * available via {@link getRequest()}, {@link getResponse()}, and
  * {@link getInvokeArgs()}, respectively.
  *
  * When overriding the constructor, please consider this usage as a best
  * practice and ensure that each is registered appropriately; the easiest
  * way to do so is to simply call parent::__construct($request, $response,
  * $invokeArgs).
  *
  * After the request, response, and invokeArgs are set, the
  * {@link $_helper helper broker} is initialized.
  *
  * Finally, {@link init()} is called as the final action of
  * instantiation, and may be safely overridden to perform initialization
  * tasks; as a general rule, override {@link init()} instead of the
  * constructor to customize an action controller's instantiation.
  *
  * @param Zend_Controller_Request_Abstract $request
  * @param Zend_Controller_Response_Abstract $response
  * @param array $invokeArgs Any additional invocation arguments
  * @return void
  */
 public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
 {
     if (!$request instanceof HCLI_Controller_Request_Cli) {
         throw new Exception("CliController may only be accessed from the command line");
     }
     parent::__construct($request, $response, $invokeArgs);
 }
开发者ID:bokultis,项目名称:kardiomedika,代码行数:33,代码来源:Action.php

示例5: __construct

 /**
  * Disables the view for the Zend Framework environment.
  *
  * @param Zend_Controller_Request_Abstract $request
  * @param Zend_Controller_Response_Abstract $response
  * @param array $invokeArgs
  */
 public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
 {
     parent::__construct($request, $response, $invokeArgs);
     $this->_helper->layout()->disableLayout();
     $this->getHelper('viewRenderer')->setNoRender();
     header("Connection: close");
 }
开发者ID:rootzig,项目名称:SNEP,代码行数:14,代码来源:Controller.php

示例6: __construct

 /**
  * Class constructor
  *
  *
  * @param Zend_Controller_Request_Abstract $request
  * @param Zend_Controller_Response_Abstract $response
  * @param array $invokeArgs Any additional invocation arguments
  * @return void
  */
 public function __construct(\Zend_Controller_Request_Abstract $request, \Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
 {
     if ($request->isXmlHttpRequest()) {
         $response->setHeader('content-type', 'application/x-www-form-urlencoded; charset=iso-8859-1', true);
     }
     parent::__construct($request, $response, $invokeArgs);
 }
开发者ID:Eximagen,项目名称:sochi,代码行数:16,代码来源:BaseController.php

示例7: __construct

 public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array(), $params = null)
 {
     if (!is_null($params)) {
         $this->params = $params;
     }
     parent::__construct($request, $response, $invokeArgs);
 }
开发者ID:IASA-GR,项目名称:appdb-core,代码行数:7,代码来源:Api02Controller.php

示例8: __construct

 /**
  * Constructor.
  *
  * @param Zend_Controller_Request_Abstract $request request
  * @param Zend_Controller_Response_Abstract $response response
  * @param array $invokeArgs parameters
  * @throws Zend_Exception
  */
 public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
 {
     if ($this->isDebug()) {
         $this->_controllerTimer = microtime(true);
     }
     $this->loadElements();
     parent::__construct($request, $response, $invokeArgs);
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:16,代码来源:GlobalController.php

示例9: __construct

 /**
  * Base controller constructor.
  *
  * Does the following things:
  *
  * - Aliases the redirector helper to clean up the syntax
  * - Sets the table object automatically if given the class of the model 
  * to use for CRUD.
  * - Sets all the built-in action contexts for the CRUD actions.
  * 
  *
  * Instead of overriding this constructor, controller subclasses should
  * implement the init() method for initial setup.
  *
  * @see Zend_Controller_Action::init()
  * @param Zend_Controller_Request_Abstract $request Current request object.
  * @param Zend_Controller_Response_Abstract $response Response object.
  * @param array $invokeArgs Arguments passed to Zend_Controller_Action.
  */
 public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
 {
     parent::__construct($request, $response, $invokeArgs);
     if ($this->getParam('result') == 'no') {
         unset($_SESSION['RESULTS_URL']);
     }
     $this->_setActionContexts();
 }
开发者ID:kyfr59,项目名称:cg35,代码行数:27,代码来源:AbstractActionController.php

示例10: __construct

 /**
  * Class constructor
  *
  * The request and response objects should be registered with the
  * controller, as should be any additional optional arguments; these will be
  * available via {@link getRequest()}, {@link getResponse()}, and
  * {@link getInvokeArgs()}, respectively.
  *
  * When overriding the constructor, please consider this usage as a best
  * practice and ensure that each is registered appropriately; the easiest
  * way to do so is to simply call parent::__construct($request, $response,
  * $invokeArgs).
  *
  * After the request, response, and invokeArgs are set, the
  * {@link $_helper helper broker} is initialized.
  *
  * Finally, {@link init()} is called as the final action of
  * instantiation, and may be safely overridden to perform initialization
  * tasks; as a general rule, override {@link init()} instead of the
  * constructor to customize an action controller's instantiation.
  *
  * @param Zend_Controller_Request_Abstract $request
  * @param Zend_Controller_Response_Abstract $response
  * @param array $invokeArgs Any additional invocation arguments
  * @return void
  */
 public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
 {
     parent::__construct($request, $response, $invokeArgs);
     if ($this->getRequest()->isXmlHttpRequest()) {
         $this->_helper->layout()->disableLayout();
     } else {
         $this->view->headScript()->appendFile('/js/ajaxForm.js');
     }
 }
开发者ID:bokultis,项目名称:kardiomedika,代码行数:35,代码来源:Form.php

示例11: __construct

 public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
 {
     if ($request === null) {
         throw new Am_Exception_InternalError("Class " . get_class($this) . " constructed without \$request and \$response");
     }
     $invokeArgs['noViewRenderer'] = true;
     $this->view = $invokeArgs['di']->view;
     parent::__construct($request, $response, $invokeArgs);
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:9,代码来源:Controller.php

示例12: __construct

 public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
 {
     parent::__construct($request, $response, $invokeArgs);
     $this->viewSuffix = 'html';
     $this->getHelper('ViewRenderer')->setViewSuffix('html');
     $bootstrap = $this->getFrontController()->getParam('bootstrap');
     $aganConfig = $bootstrap->getOption('agan');
     $this->_templatePath = $aganConfig['template']['path'];
     $this->_viewScriptPath = $bootstrap->getOption('resources');
     $this->_viewScriptPath = $this->_viewScriptPath['view']['basePath'] . '/scripts';
 }
开发者ID:laiello,项目名称:xinhuxi,代码行数:11,代码来源:Action.php

示例13: __construct

 public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
 {
     if (!$request instanceof Sitengine_Controller_Request_Http) {
         require_once 'Sitengine/Controller/Exception.php';
         throw new Sitengine_Controller_Exception('request must be an instance of Sitengine_Controller_Request_Http');
     }
     if (!$response instanceof Zend_Controller_Response_Abstract) {
         require_once 'Sitengine/Controller/Exception.php';
         throw new Sitengine_Controller_Exception('response must be an instance of Zend_Controller_Response_Abstract');
     }
     parent::__construct($request, $response, $invokeArgs);
 }
开发者ID:sitengine,项目名称:sitengine,代码行数:12,代码来源:Action.php

示例14: __construct

 public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
 {
     parent::__construct($request, $response, $invokeArgs);
     $view = $this->view;
     $view->doctype('XHTML1_STRICT');
     $view->headMeta()->appendHttpEquiv('Content-Type', 'text/html;charset=utf-8');
     $view->headTitle()->setSeparator(' - ');
     $view->addHelperPath(APPLICATION_PATH . '/views/helpers/');
     $view->headLink(array('rel' => 'icon', 'href' => 'img/favicon.ico', 'type' => 'image/x-icon'))->headLink(array('rel' => 'apple-touch-icon', 'href' => 'img/apple-touch-icon.png', 'sizes' => '72x72'))->appendStylesheet('css/screen.css', 'screen');
     $titles = Zend_Registry::get('Zend_Config')->title;
     if ($titles) {
         foreach ($titles as $title) {
             $view->headTitle($title);
         }
     }
 }
开发者ID:heiglandreas,项目名称:ShortURL,代码行数:16,代码来源:Action.php

示例15: __construct

 /**
  * Class constructor
  *
  * The request and response objects should be registered with the
  * controller, as should be any additional optional arguments; these will be
  * available via {@link getRequest()}, {@link getResponse()}, and
  * {@link getInvokeArgs()}, respectively.
  *
  * When overriding the constructor, please consider this usage as a best
  * practice and ensure that each is registered appropriately; the easiest
  * way to do so is to simply call parent::__construct($request, $response,
  * $invokeArgs).
  *
  * After the request, response, and invokeArgs are set, the
  * {@link $_helper helper broker} is initialized.
  *
  * Finally, {@link init()} is called as the final action of
  * instantiation, and may be safely overridden to perform initialization
  * tasks; as a general rule, override {@link init()} instead of the
  * constructor to customize an action controller's instantiation.
  *
  * @param Zend_Controller_Request_Abstract $request
  * @param Zend_Controller_Response_Abstract $response
  * @param array $invokeArgs Any additional invocation arguments
  * @return void
  */
 public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
 {
     parent::__construct($request, $response, $invokeArgs);
     if (isset($this->ajaxable)) {
         // Init AjaxContexts
         $ajaxContext = $this->getHelper('AjaxContext');
         $ajaxContext->initContext();
     }
     if (isset($this->contexts)) {
         // TODO: TEMPORARY FIX FOR ZF-3690
         if (!isset($ajaxContext) || isset($ajaxContext) && $ajaxContext->getCurrentContext() === null) {
             // Init ContextSwitch
             $this->getHelper('ContextSwitch')->initContext();
         }
     }
 }
开发者ID:BGCX262,项目名称:zym-svn-to-git,代码行数:42,代码来源:Abstract.php


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