本文整理汇总了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();
}
示例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;
}
示例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();
示例4: exportAction
public function exportAction()
{
$this->view->param = $this->_request;
$option = array("layout" => "index", "layoutPath" => APPLICATION_PATH . "/layouts/export");
Zend_Layout::startMVC($option);
}