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


PHP Zend_Controller_Action::init方法代码示例

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


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

示例1: init

 public function init()
 {
     $data = $this->getRequestJson();
     if (!$data) {
         $data = $this->getRequest();
     }
     if (array_key_exists('session_uuid', $data)) {
         if (!Zend_Session::isStarted()) {
             Glo_Auth_Storage_Session::setId($data['session_uuid']);
             $storage = new Glo_Auth_Storage_Session('Glo_Auth');
             $sessoinData = $storage->read();
             if (!is_object($sessoinData) || !isset($data['user_uuid']) || $sessoinData->user_uuid != $data['user_uuid']) {
                 throw new Glo_Exception_InvalidSession('Your session is invalid.');
             }
         }
     }
     /*         $this->loggedInUser = App_Model_User::getLoggedIn(); */
     return parent::init();
     /*
             // load the logged in user if there is one
             $this->view->loggedInUser = User::getLoggedIn();
             
             // set the translate adapter
             $this->registerTranslator();
     */
 }
开发者ID:highhair20,项目名称:glo,代码行数:26,代码来源:Api.php

示例2: init

 public function init()
 {
     parent::init();
     $this->_model = array('time' => new Application_Model_Time(), 'jogo' => new Application_Model_Jogo(), 'apostador' => new Application_Model_Aposta(), 'resultado' => new Application_Model_Resultado(), 'detalhe_aposta' => new Application_Model_DetalheAposta());
     #$this->_helper->viewRenderer->setNoRender(true);
     $this->_helper->layout->disableLayout();
 }
开发者ID:r4faelaugusto,项目名称:b0l4od0fu7uro,代码行数:7,代码来源:AcompanhamentoController.php

示例3: init

 /**
  * (non-PHPdoc)
  * @see Zend_Controller_Action::init()
  */
 public function init()
 {
     parent::init();
     $this->_bootstrap = $this->getInvokeArg('bootstrap');
     $accessToken = $this->_request->getParam('access_token', $this->_request->getHeader('OAuth-AccessToken'));
     $memcache = $this->_bootstrap->getResource('memcache');
     Tudu_User::setMemcache($memcache);
     $this->_user = Tudu_User::getInstance();
     // 提供访问令牌
     if (!empty($accessToken)) {
         $storage = new TuduX_OAuth_Storage_Session();
         $storage->setMemcache($memcache);
         $oauth = new OpenApi_OAuth_OAuth(array(OpenApi_OAuth_OAuth::STORAGE => $storage));
         $scope = $this->_request->getParam('client_id', $this->_request->getHeader('OAuth-Scope'));
         try {
             $token = $oauth->verifyAccessToken($accessToken, $scope);
             $this->_user->init($token['auth']);
             // 用户被禁用或已被退出登录
             if (!$this->_user->isLogined()) {
                 $oauth->destroyAccessToken($accessToken);
                 throw new OpenApi_OAuth_Exception("Invalid access token provided", OpenApi_OAuth_OAuth::ERROR_INVALID_ACCESSTOKEN);
             }
             // ts服务器
             $tsServer = 'ts' . $this->_user->tsId;
             Tudu_Dao_Manager::setDbs(array(Tudu_Dao_Manager::DB_TS => $this->_bootstrap->multidb->getDb($tsServer)));
             $this->_clientId = $token[OpenApi_OAuth_OAuth::PARAM_CLIENT_ID];
             $this->_accessToken = $accessToken;
             $this->_token = $token;
             // 验证失败
         } catch (OpenApi_OAuth_Exception $e) {
             throw $e;
         }
     }
 }
开发者ID:bjtenao,项目名称:tudu-web,代码行数:38,代码来源:OpenApi.php

示例4: init

 public function init()
 {
     parent::init();
     $config_options = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getOptions();
     $moduleName = $this->getRequest()->getModuleName();
     $controllerName = $this->getRequest()->getControllerName();
     $controllerType = $this->controllerType;
     $themeName = $config_options['awe']['theme'][$this->controllerType];
     $namespace = substr($controllerName, 0, strpos('_', $controllerName));
     $templatesFolder = APPLICATION_PATH . '/templates';
     $paths = array();
     // first check admin theme
     // then check admin default
     // then frontend theme
     // then frontend default
     $paths[] = "/frontend/default/views/scripts/{$moduleName}";
     if ($themeName != 'default') {
         $paths[] = "/frontend/{$themeName}/views/scripts/{$moduleName}";
     }
     $skinPath = "/skin/frontend/{$themeName}";
     if ($moduleName == 'admin') {
         $paths[] = "/admin/default/views/scripts";
         if ($themeName != 'default') {
             $paths[] = "/admin/{$themeName}/views/scripts";
         }
         $skinPath = "/skin/admin/{$themeName}";
     }
     $this->pView = new Zend_View();
     $this->pView->addScriptPath($templatesFolder . "/frontend/{$themeName}/layouts/widgets");
     \Zend_Registry::set('awe_theme_skinPath', $skinPath);
     foreach ($paths as $path) {
         $fullPath = $templatesFolder . $path;
         $this->view->addScriptPath($fullPath);
     }
 }
开发者ID:rocksolidwebdesign,项目名称:AweCMS,代码行数:35,代码来源:Themed.php

示例5: init

 public function init()
 {
     parent::init();
     $this->_flashMessenger = new Core_Controller_Action_Helper_FlashMessengerCustom();
     $this->_config = $this->getConfig();
     $this->_layout = Zend_Layout::getMvcInstance();
 }
开发者ID:josmel,项目名称:HosPot,代码行数:7,代码来源:Action.php

示例6: init

 public function init()
 {
     parent::init();
     $session = new Zend_Session_Namespace('userSession');
     $this->view->hata = $session->hataMesaji;
     $session->hataMesaji = NULL;
 }
开发者ID:ugurcanelveren,项目名称:egitim,代码行数:7,代码来源:GirisController.php

示例7: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->_dtoManager = new Api_Manager_Dto();
     $this->_annotationManager = new Api_Manager_Annotation(new Api_Annotation_Reader_Simple(), new Api_Annotation_Injector_Simple());
     $this->_helper->viewRenderer->setNoRender(true);
 }
开发者ID:lordmx,项目名称:currency_parser,代码行数:10,代码来源:Base.php

示例8: init

 public function init()
 {
     parent::init();
     $helper = new vkNgine_View_Helper_PublicUrl();
     $this->view->registerHelper($helper, 'publicUrl');
     $helper = new vkNgine_View_Helper_Seo();
     $this->view->registerHelper($helper, 'seo');
     $helper = new vkNgine_View_Helper_AssetUrl();
     $this->view->registerHelper($helper, 'assetUrl');
     $helper = new vkNgine_View_Helper_Dateformat();
     $this->view->registerHelper($helper, 'dateFormat');
     $searchForm = new Public_Model_Form_Search();
     $this->view->searchForm = $searchForm;
     $view = Zend_Registry::get('view');
     $appTitle = Zend_Registry::get('t')->_('GYM Tracker');
     $view->headTitle($appTitle, Zend_View_Helper_Placeholder_Container_Abstract::SET);
     if (!vkNgine_Auth::isAuthenticated()) {
         header("location:/auth/login");
         exit;
     }
     $modelExercises = new Model_Exercises();
     $this->view->exercises = $modelExercises;
     $user = vkNgine_Public_Auth::revalidate();
     $this->view->params = $this->getAllParams();
     Zend_Registry::set('user', $user);
     $this->view->assign('user', $user);
     $this->user = Zend_Registry::get('user');
     $this->view->t = Zend_Registry::get('t');
     $this->t = Zend_Registry::get('t');
 }
开发者ID:AlexanderMazaletskiy,项目名称:gym-Tracker-App,代码行数:30,代码来源:Controller.php

示例9: init

 public function init()
 {
     parent::init();
     // just good habit (nothing there currently)
     // maps to arg 'view' from: $frontController->setParam('view', $view);
     $this->_view = $this->getInvokeArg('view');
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:7,代码来源:IndexController.php

示例10: init

 public function init()
 {
     parent::init();
     $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');
     $this->category = new Application_Model_Category();
     $this->rubrique_image = new Application_Model_RubriqueImage();
 }
开发者ID:nitishpeeroo,项目名称:BackOffice,代码行数:7,代码来源:CategoryController.php

示例11: init

 public function init()
 {
     parent::init();
     $this->registry = Zend_Registry::getInstance();
     $this->initView();
     //cms
     $this->view->setScriptPath('./application/views/scripts/');
     $this->view->setHelperPath('./application/views/helpers/', 'Helper');
     $this->view->addHelperPath('./library/Zcms/View/helper/', 'Zcms_View_Helper');
     $this->view->addBasePath('./html/', '');
     //Zsurforce
     $this->view->addHelperPath('./library/Zsurforce/View/Helper/', 'Zsurforce_View_Helper');
     $this->view->baseUrl = $this->_request->getBaseUrl();
     $this->view->basePath = $this->registry->get('base_path');
     Zend_Loader::loadClass('Configuracion');
     $this->view->user = Zend_Auth::getInstance()->getIdentity();
     $this->info = $this->registry->get('personalizacion');
     $this->view->title = $this->info->sitio->index->index->titulo;
     $this->session = $this->registry->get('session');
     $this->view->session = $this->session;
     $this->debug = $this->registry->get('debug');
     $this->view->debug = $this->debug;
     /* información de sitios y subsitios */
     $this->view->sitios = Sitios::getAll(null, null, "orden")->toArray();
     if (isset($this->session->sitio->id)) {
         $this->view->configuracion = Configuracion::getConfiguracion($this->session->sitio->id);
     } else {
         $this->view->configuracion = Configuracion::getConfiguracionDefault();
         $this->session->sitio = Sitios::getSitioDefault();
     }
     $this->registrarSitio();
     $this->cargarMenuHorizontal();
     $this->_loadBreadcrumItems();
 }
开发者ID:anavarretev,项目名称:surforce-cms,代码行数:34,代码来源:Controller.php

示例12: init

 public function init()
 {
     set_time_limit(0);
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNeverRender();
     parent::init();
 }
开发者ID:ncsuwebdev,项目名称:otframework,代码行数:7,代码来源:ApiController.php

示例13: init

 public function init()
 {
     $this->noCache();
     parent::init();
     $this->_helper->layout->setLayout('layout-servicios');
     $this->_flashMessage = new App_Controller_Action_Helper_FlashMessengerCustom();
 }
开发者ID:josmel,项目名称:PortalWapMovistar,代码行数:7,代码来源:ServiciosController.php

示例14: init

 public function init()
 {
     parent::init();
     $this->getResponse()->setHeader("Cache-Control", "no-cache, must-revalidate");
     $this->_helper->contextSwitch()->initContext();
     $this->_helper->layout->disableLayout();
 }
开发者ID:Cryde,项目名称:sydney-core,代码行数:7,代码来源:SafactivitylogController.php

示例15: init

 /**
  * (non-PHPdoc)
  * @see Zend_Controller_Action::init()
  */
 public function init()
 {
     parent::init();
     $this->_helper->viewRenderer->setNoRender(true);
     $this->_helper->layout()->disableLayout();
     $this->_config = Zend_Registry::get('config');
 }
开发者ID:fredcido,项目名称:simuweb,代码行数:11,代码来源:ServiceController.php


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