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


PHP Zend_Layout::startMVC方法代码示例

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


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

示例1: init

 public function init()
 {
     parent::init();
     $this->view->doctype('XHTML1_STRICT');
     $this->view->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8');
     $this->_helper->viewRenderer->setNoRender(true);
     $this->view->getHelper('baseUrl')->setBaseUrl(BASE_URL);
     defined('LAST_TEMP') || define('LAST_TEMP', BASE_URL . UDS . Base_Constant_Server::LAST_TEMP_DIRECTORY . UDS);
     $registry = Zend_Registry::getInstance();
     $registry->moduleName = $this->_request->getModuleName();
     $registry->controllerName = $this->_request->getControllerName();
     $registry->actionName = $this->_request->getActionName();
     $modulePath = $registry->modulePaths[$registry->moduleName];
     $controllerPath = $registry->controllerPaths[$registry->moduleName];
     $registry->modulePath = $modulePath;
     $this->view->moduleName = $registry->moduleName;
     $this->view->controllerName = $registry->controllerName;
     $this->view->actionName = $registry->actionName;
     /** title page, site name, meta tag*/
     //$this->view->siteName = $registry->appConfig['siteName'];
     $hTranslate = new Base_Helper_Translate();
     $this->view->siteName = $hTranslate->translate(Base_Constant_Client::getInstance()->getSetting('siteName'), 'value');
     $description = '<meta name="description" content="' . $hTranslate->translate(Base_Constant_Client::getInstance()->getSetting('meta_desc'), 'value') . '">';
     $keywords = '<meta name="keywords" content="' . $hTranslate->translate(Base_Constant_Client::getInstance()->getSetting('meta_keywords'), 'value') . '">';
     $author = '<meta name="author" content="' . $hTranslate->translate(Base_Constant_Client::getInstance()->getSetting('meta_author'), 'value') . '">';
     $this->view->metaTag = $description . $keywords . $author;
     /** title page, site name, meta tag*/
     $layoutPath = $modulePath . DS . 'views' . DS . 'layouts';
     if (!is_dir($layoutPath)) {
         $layoutPath = WWW_PATH . DS . 'views' . DS . 'layouts';
     }
     Zend_Layout::startMVC(array("layout" => 'layout', "layoutPath" => $layoutPath));
     $registry['mvcOptions'] = array("layout" => 'layout', "layoutPath" => $layoutPath);
     is_null($this->_request->getParam('ajax')) || $this->_helper->layout()->disableLayout();
     $registry->headLink = $this->_cacheHeadLink();
     $registry->headScript = $this->_cacheHeadScript();
     $registry->currentUser = new Base_Php_Overloader(Zend_Auth::getInstance()->getIdentity());
     $this->initOther();
 }
开发者ID:HuyTran0424,项目名称:noeavrsev345452dfgdfgsg,代码行数:39,代码来源:Action.php

示例2: _initLayout

 /**
  *	Initialize the main layout handler.
  *	@return Zend_Layout
  */
 protected function _initLayout()
 {
     $layout = (array) $this->getResource('layout');
     $this->_layout = Zend_Layout::startMVC($layout);
     Zend_Registry::getInstance()->set('layout', $this->_layout);
     return $this->_layout;
 }
开发者ID:aldimol,项目名称:zf-sample,代码行数:11,代码来源:Bootstrap.php

示例3: define

<?php

// bootstrap
define('BASE', dirname(dirname(__FILE__)));
date_default_timezone_set('Africa/Johannesburg');
set_include_path(get_include_path() . PATH_SEPARATOR . '/usr/share/php5/ZendFramework/library' . PATH_SEPARATOR . BASE . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'models' . PATH_SEPARATOR . BASE . DIRECTORY_SEPARATOR . 'lib');
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();
// load config
$config = new Zend_Config_Ini(BASE . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'config.ini', 'live');
Zend_Registry::set('config', $config);
// connect to the database
$db = Zend_Db::factory($config->db->adapter, $config->db->conn->toArray());
Zend_Db_Table::setDefaultAdapter($db);
Zend_Registry::set('db', $db);
// view
Zend_Layout::startMVC();
// dispatch
$front = Zend_Controller_Front::getInstance();
$front->setRouter(new App_Controller_Router());
$front->setControllerDirectory(BASE . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'controllers');
$front->dispatch();
开发者ID:neilgarb,项目名称:codecaine,代码行数:22,代码来源:index.php

示例4: exportAction

 public function exportAction()
 {
     $this->view->param = $this->_request;
     $option = array("layout" => "index", "layoutPath" => APPLICATION_PATH . "/layouts/export");
     Zend_Layout::startMVC($option);
 }
开发者ID:LongNguyen-51101909,项目名称:Dimopla,代码行数:6,代码来源:IndexController.php


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