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


PHP Zend_Layout::getMvcInstance方法代码示例

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


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

示例1: aboutAction

 public function aboutAction()
 {
     if ($this->_request->isXmlHttpRequest()) {
         $layout = Zend_Layout::getMvcInstance();
         $layout->disableLayout();
     }
 }
开发者ID:brunopbaffonso,项目名称:ongonline,代码行数:7,代码来源:IndexController.php

示例2: dispatchLoopStartup

 public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
 {
     $auth = Zend_Auth::getInstance();
     $result = $auth->getStorage();
     $identity = $auth->getIdentity();
     $registry = Zend_Registry::getInstance();
     $config = Zend_Registry::get('config');
     $module = strtolower($this->_request->getModuleName());
     $controller = strtolower($this->_request->getControllerName());
     $action = strtolower($this->_request->getActionName());
     if ($identity && $identity != "") {
         $layout = Zend_Layout::getMvcInstance();
         $view = $layout->getView();
         $view->login = $identity;
         $siteInfoNamespace = new Zend_Session_Namespace('siteInfoNamespace');
         $id = $siteInfoNamespace->userId;
         $view->firstname = $siteInfoNamespace->Firstname;
         $username = $siteInfoNamespace->username;
         $password = $siteInfoNamespace->password;
         $db = new Zend_Db_Adapter_Pdo_Mysql(array('host' => $config->resources->db->params->host, 'username' => $username, 'password' => $password, 'dbname' => $config->resources->db->params->dbname));
         Zend_Db_Table_Abstract::setDefaultAdapter($db);
         return;
     } else {
         $siteInfoNamespace = new Zend_Session_Namespace('siteInfoNamespace');
         $siteInfoNamespace->requestURL = $this->_request->getParams();
         $this->_request->setModuleName('default');
         $this->_request->setControllerName('Auth');
         $this->_request->setActionName('login');
     }
 }
开发者ID:papoteur-mga,项目名称:phpip,代码行数:30,代码来源:AuthPlugin.php

示例3: routeShutdown

 public function routeShutdown(Zend_Controller_Request_Abstract $request)
 {
     Zend_Layout::getMvcInstance()->setLayout($request->getModuleName());
     Zend_Layout::getMvcInstance()->setLayoutPath(APPLICATION_PATH . "/modules/" . $request->getModuleName() . "/layouts/scripts");
     $eh = Zend_Controller_Front::getInstance()->getPlugin("Zend_Controller_Plugin_ErrorHandler");
     $eh->setErrorHandlerModule($request->getModuleName());
 }
开发者ID:nnevala,项目名称:zf-boilerplate,代码行数:7,代码来源:ModuleLayout.php

示例4: init

 function init()
 {
     $this->_redirector = $this->_helper->getHelper('Redirector');
     $this->_layout = $this->_helper->getHelper('Layout');
     $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');
     //Get Controller,Action,Module Name
     $this->_moduleName = Zend_Controller_Front::getInstance()->getRequest()->getModuleName();
     $this->_controllerName = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
     $this->_actionName = Zend_Controller_Front::getInstance()->getRequest()->getActionName();
     $this->_cleanUrl = $this->view->rootUrl() . '/' . $this->_moduleName . '/' . $this->_controllerName . '/' . $this->_actionName;
     //get user profile
     $this->setUserProfile();
     //Set layout
     $layout = Zend_Layout::getMvcInstance();
     $layout->setLayoutPath(APPLICATION_PATH . '/modules/admin/layouts');
     $layout->setLayout('admin');
     //set redirector helper
     $this->_redirector = $this->_helper->getHelper('Redirector');
     //set flash messenger
     $this->_flash = $this->_helper->FlashMessenger;
     //set Edit state
     if ($this->_actionName == 'edit') {
         $this->view->state_edit = TRUE;
     }
     //set paginator session
     $this->_paginator_sess = new Zend_Session_Namespace('paginator');
     $this->setPaginatorSession();
     //set default language (untuk sementara)
     Zend_Registry::set('language', 'en');
 }
开发者ID:abdulhadikaryana,项目名称:kebudayaan,代码行数:30,代码来源:Backend.php

示例5: preDispatch

 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     if (!isset($_SERVER['HTTP_USER_AGENT']) || isset($_SERVER['HTTP_USER_AGENT']) && false === strpos($_SERVER['HTTP_USER_AGENT'], 'sanmax-crawler-bot')) {
         return;
     }
     $config = array('accept_schemes' => 'basic', 'realm' => 'crawler', 'digest_domains' => '/', 'nonce_timeout' => 3600);
     $adapter = new Zend_Auth_Adapter_Http($config);
     $basicResolver = new Zend_Auth_Adapter_Http_Resolver_File(APPLICATION_PATH . '/var/bot-basic');
     $adapter->setBasicResolver($basicResolver);
     $response = Zend_Controller_Front::getInstance()->getResponse();
     $adapter->setRequest($request);
     $adapter->setResponse($response);
     $auth = Zend_Auth::getInstance();
     $result = $auth->authenticate($adapter);
     if (!$result->isValid()) {
         $response->sendHeaders();
         exit;
     }
     $user = new SxCms_User();
     $gMapper = new SxCms_Group_DataMapper();
     $groups = $gMapper->getAll();
     foreach ($groups as $group) {
         $user->addGroup($group);
     }
     $storage = $auth->getStorage();
     $storage->write($user);
     $front = Zend_Controller_Front::getInstance();
     $front->setParam('isBot', true);
     $mvc = Zend_Layout::getMvcInstance();
     $view = $mvc->getView();
     $view->isBot = true;
     return;
 }
开发者ID:sonvq,项目名称:2015_freelance6,代码行数:33,代码来源:HTTPCrawler.php

示例6: updateScreenshot

 public function updateScreenshot($values)
 {
     if (!empty($values['project'])) {
         $this->project_id = $values['project'];
     }
     if (!empty($values['description'])) {
         $this->description = $values['description'];
     }
     if ($values['file'] instanceof Zend_Form_Element_File) {
         $file = $values['file']->receive();
         if (!$file) {
             throw new Zend_Exception('There was an error with the file upload.');
         }
         if (!empty($this->screenshot)) {
             $file = explode('/', $this->screenshot);
             $file = $file[count($file) - 1];
             @unlink(realpath(UPLOAD_PATH . '/screenshots/') . DIRECTORY_SEPARATOR . $file);
         }
         if (!empty($values['screen'])) {
             $view = Zend_Layout::getMvcInstance()->getView();
             $this->screenshot = $view->baseUrl('/upload/screenshots/' . $values['screen']);
         }
     }
     $this->save();
 }
开发者ID:KasaiDot,项目名称:FansubCMS,代码行数:25,代码来源:Screenshot.php

示例7: preDispatch

 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     $flash = Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger');
     $mvc = Zend_Layout::getMvcInstance();
     $view = $mvc->getView();
     $view->flashMessages = $flash->getMessages();
 }
开发者ID:sonvq,项目名称:2015_freelance6,代码行数:7,代码来源:Messenger.php

示例8: preDispatch

 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     $module = $request->getModuleName();
     if ($module != 'default') {
         Zend_Layout::getMvcInstance()->setLayoutPath(APPLICATION_PATH . DIRECTORY_SEPARATOR . "modules" . DIRECTORY_SEPARATOR . $module . DIRECTORY_SEPARATOR . "layouts" . DIRECTORY_SEPARATOR . "scripts");
     }
 }
开发者ID:nandinibhaduri,项目名称:zendAcl,代码行数:7,代码来源:ModuleLayoutHandler.php

示例9: preDispatch

 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     Zend_Auth::getInstance()->setStorage(new Dfi_Auth_Storage_Cookie('user'));
     /** @var Zend_Controller_Request_Http $request */
     $request = $this->getRequest();
     $bypass = $this->isBypassRequest($request->getModuleName(), $request->getControllerName(), $request->getActionName());
     if (!Zend_Auth::getInstance()->hasIdentity() && !$bypass) {
         if ($request->isXmlHttpRequest()) {
             $response = $this->getResponse();
             $data = array('auth' => true);
             $output = json_encode($data);
             $response->setHeader('Content-Type', 'application/json', true);
             $this->getResponse()->setBody($output);
             $this->getResponse()->sendResponse();
             exit;
         } else {
             if ($request->getControllerName() == 'index' && $request->getActionName() == 'index') {
                 if (!Zend_Layout::getMvcInstance()) {
                     $layoutPath = Dfi_App_Config::get('layout.layoutPath');
                     Zend_Layout::startMvc($layoutPath);
                 }
             }
             $request->setControllerName('login');
             $request->setActionName('index');
             $request->setModuleName('default');
         }
     }
 }
开发者ID:dafik,项目名称:dfi,代码行数:28,代码来源:Login.php

示例10: indexAction

 /**
  * Show categories list ( based on parent_id ). if no sub category found - will forward to products list
  *
  * @var integer $pcategory Parent category
  */
 public function indexAction()
 {
     $categoriesModel = new Model_DbTable_Categories();
     $select = $categoriesModel->select();
     if (NULL != ($parent_id = $this->getRequest()->getParam("category"))) {
         $category = $categoriesModel->find($parent_id)->current();
         $this->view->category = $category;
         $select->where("`parent_id` = ?", $parent_id);
         $this->view->headTitle()->prepend("Альфа-Гидро: Каталог продукции - " . $category['name']);
     } else {
         $select->where("`parent_id` = ?", 0);
         $this->view->headTitle()->prepend("Альфа-Гидро: Продукция");
     }
     $select->order(new Zend_Db_Expr('`order`<=-100'))->order("order");
     if (!Zend_Auth::getInstance()->hasIdentity()) {
         $select->where("`order` != -100 OR `order` IS NULL");
     }
     $this->view->rowset = $categoriesModel->fetchAll($select);
     if ($this->getRequest()->isXmlHttpRequest()) {
         $this->view->curRowId = $this->getRequest()->getParam("currentCategory");
         $this->_helper->viewRenderer->setRender('index-ajax');
         Zend_Layout::getMvcInstance()->disableLayout();
         return;
     }
     if (count($this->view->rowset) == 0) {
         $this->forward("index", "products");
         return;
     }
 }
开发者ID:Alpha-Hydro,项目名称:alpha-hydro-antares,代码行数:34,代码来源:CategoriesController.php

示例11: indexAction

 public function indexAction()
 {
     $this->_helper->viewRenderer->setNoRender(false);
     $this->_helper->layout()->enableLayout();
     if ($this->getRequest()->isPost()) {
         if ($this->_getParam('num_cnpj') == '') {
             Zend_Layout::getMvcInstance()->assign('msg_error', 'Campo CNPJ é obrigatório !');
         } else {
             if (strlen($this->_getParam('num_cnpj')) < 18) {
                 Zend_Layout::getMvcInstance()->assign('msg_error', 'CNPJ está incorreto !');
             } else {
                 $num_cnpj = $this->_getParam('num_cnpj', '');
                 $this->view->assign('num_cnpj', $num_cnpj);
                 // Incluir arquivo de cliente web service
                 require_once 'Zend/Rest/Client.php';
                 // Criar classe da conexão com o web-service
                 $clientRest = new Zend_Rest_Client('http://' . $_SERVER['HTTP_HOST'] . '/Consulta/sintegra');
                 // Fazer requisição do registro
                 $result = $clientRest->ConsultarRegistro($num_cnpj, $this->generateAuthKey())->get();
                 $result = json_decode($result);
                 if (count($result) <= 0) {
                     Zend_Layout::getMvcInstance()->assign('msg_error', 'Não foi encontrado nenhum registro para o CNPJ ' . $num_cnpj);
                 } else {
                     $result = get_object_vars($result[0]);
                     Zend_Layout::getMvcInstance()->assign('msg_success', 'Exibindo dados do CNPJ ' . $num_cnpj);
                     $this->view->assign('result', $result);
                 }
             }
         }
     }
 }
开发者ID:DaviSouto,项目名称:UpLexis_Sintegra-Teste-PHP,代码行数:31,代码来源:ConsultaController.php

示例12: loginAction

 public function loginAction()
 {
     Zend_Layout::getMvcInstance()->setLayout('layout-login2');
     $request = $this->getRequest();
     $returnUrl = $request->getParam('returnUrl', null);
     $this->view->assign('returnUrl', $returnUrl);
 }
开发者ID:hukumonline,项目名称:admin,代码行数:7,代码来源:AuthController.php

示例13: indexAction

 public function indexAction()
 {
     $this->_helper->viewRenderer->setNoRender(true);
     Zend_Layout::getMvcInstance()->disableLayout();
     $conf = new Z_Config('robots.txt');
     echo $conf->getValue();
 }
开发者ID:Konstnantin,项目名称:zf-app,代码行数:7,代码来源:RobotsController.php

示例14: preDispatch

 /**
  * Set navigation object based on conference abbreviation
  *
  * @return	void
  */
 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     $acl = new Core_Model_Acl_Core();
     $auth = Zend_Auth::getInstance();
     $view = Zend_Layout::getMvcInstance()->getView();
     // get user role
     $role = $auth->hasIdentity() ? $auth->getIdentity() : 'guest';
     // store ACL in global registry
     Zend_Registry::set('acl', $acl);
     $abbreviation = 'core';
     try {
         $conference = Zend_Registry::get('conference');
         if ($conference['navigation']) {
             $abbreviation = strtolower($conference['abbreviation']);
         }
     } catch (Exception $e) {
         throw new TA_Exception('conference key not found in registry');
     }
     $pages = (require APPLICATION_PATH . '/configs/navigation/' . $abbreviation . '.php');
     $this->_navigation = new Zend_Navigation($pages);
     // view helper
     $navViewHelper = $view->navigation($this->_navigation);
     // add ACL and default role to navigation
     $navViewHelper->setAcl($acl)->setRole($role);
 }
开发者ID:GEANT,项目名称:CORE,代码行数:30,代码来源:NavigationSelector.php

示例15: init

 public function init()
 {
     $session = new Zend_Session_Namespace('homelet_global');
     // Bit of a dirty hack to use a layout from the CMS module
     $layout = Zend_Layout::getMvcInstance();
     $layout->setLayoutPath(APPLICATION_PATH . '/modules/cms/layouts/scripts');
     $layout->setLayout('default');
     // Extra form css for Letting Agents
     //$this->view->headLink()->appendStylesheet('/assets/cms/css/portfolio_form.css');
     $this->view->headScript()->appendFile('/assets/cms/js/letting-agents/letting-agents_form.js');
     $this->url = trim($this->getRequest()->getRequestUri(), '/');
     $this->view->pageTitle = 'Letting Agents Application';
     $menuData = array('selected' => 'letting-agents', 'url' => $this->url);
     // This could be quite yucky - I'm just trying to work out how to get the menu structure to work
     $mainMenu = $this->view->partial('partials/homelet-mainmenu.phtml', $menuData);
     $subMenu = $this->view->partial('partials/homelet-submenu.phtml', $menuData);
     $layout = Zend_Layout::getMvcInstance();
     $layout->getView()->mainMenu = $mainMenu;
     $layout->getView()->subMenu = $subMenu;
     if (isset($menuData['selected'])) {
         $layout->getView()->styling = $menuData['selected'];
     }
     // Load the site link urls from the parameters and push them into the layout
     $params = Zend_Registry::get('params');
     $layout->getView()->urls = $params->url->toArray();
     // Some Session Stuff
     $pageSession = new Zend_Session_Namespace('letting_agents_application');
     // Unique Id
     if (!isset($pageSession->agentUniqueId)) {
         $pageSession->agentUniqueId = uniqid();
     }
 }
开发者ID:AlexEvesDeveloper,项目名称:hl-stuff,代码行数:32,代码来源:SignUpController.php


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