本文整理汇总了PHP中Zend_Layout::startMvc方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Layout::startMvc方法的具体用法?PHP Zend_Layout::startMvc怎么用?PHP Zend_Layout::startMvc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Layout
的用法示例。
在下文中一共展示了Zend_Layout::startMvc方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexAction
/**
* The default action - show the home page
*/
public function indexAction()
{
$this->_helper->viewRenderer->setNoRender();
Zend_Layout::startMvc(array('layout' => 'cms', 'layoutPath' => '../application/zoolu/layouts'));
$objLayout = Zend_Layout::getMvcInstance();
$objLayout->assign('navigation', $this->view->action('index', 'Navigation', 'cms'));
$objLayout->assign('userinfo', $this->view->action('userinfo', 'User', 'users'));
$objLayout->assign('modules', $this->view->action('navtop', 'Modules', 'core', array('module' => $this->core->sysConfig->modules->cms)));
$this->view->assign('jsVersion', $this->core->sysConfig->version->js);
$this->view->assign('cssVersion', $this->core->sysConfig->version->css);
$this->view->assign('rootLevelTypeId', $this->core->sysConfig->root_level_types->portals);
$this->view->assign('module', $this->core->sysConfig->modules->cms);
$strMapsKey = '';
$objThemeData = $this->getModelFolders()->getThemeByDomain($_SERVER['SERVER_NAME']);
if (count($objThemeData) > 0) {
$objTheme = $objThemeData->current();
$strMapsKey = $objTheme->mapsKey;
}
/*
* Load Plugin JS
*/
$strJsPlugin = '';
foreach ($this->core->sysConfig->pluginsJs as $key => $value) {
$strJsPlugin .= '<script type="text/javascript" src="' . str_replace('{MAPSKEY}', $strMapsKey, $value) . '"></script>';
}
$this->view->assign('jsPlugins', $strJsPlugin);
}
示例2: dispatchLoopStartup
public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
{
$layout = Zend_Layout::startMvc();
$layout->setLayoutPath(APP_PATH . '/default/views/scripts/layouts');
$layout->setLayout('default');
parent::dispatchLoopShutdown();
}
示例3: dispatchLoopStartup
public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
{
$moduleName = $request->getModuleName();
Zend_Layout::startMvc();
$layout = Zend_Layout::getMvcInstance();
switch ($moduleName) {
case 'admin':
$layout->setLayoutPath(APPLICATION_PATH . '/layouts/scripts/' . $moduleName);
$layout->setLayout('admin');
break;
case 'login':
$layout->setLayoutPath(APPLICATION_PATH . '/layouts/scripts/' . $moduleName);
$layout->setLayout('login');
break;
default:
$layout->setLayoutPath(APPLICATION_PATH . '/layouts/scripts/default');
$layout->setLayout('layout');
break;
}
$frontController = Zend_Controller_Front::getInstance();
$frontController->setBaseUrl('http://local.kemsakura/');
$view = Zend_Layout::getMvcInstance()->getView();
$view->addHelperPath(APPLICATION_PATH . "/layouts/helpers");
$wew = new Zend_View();
$wew->baseUrl();
}
示例4: configureTheme
function configureTheme($theme = APPLICATION_THEME, $layoutName = 'index', $layoutPath = '/themes/core/layouts')
{
global $baseUrl;
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
if ($layoutName == 'integration') {
$viewRenderer->view->themeUrl = str_replace("index.php", "", BASE_URL) . '/public/' . $theme;
$viewRenderer->view->themeImages = $viewRenderer->view->themeUrl . "/images";
} else {
$viewRenderer->view->themeUrl = str_replace("index.php", "", BASE_URL) . "/themes/" . $theme;
$viewRenderer->view->themesUrl = str_replace("index.php", "", BASE_URL) . "/themes/";
$viewRenderer->view->themeImages = $viewRenderer->view->themeUrl . "/images";
}
$viewRenderer->view->theme = $theme;
$viewRenderer->view->asset = new Joobsbox_Helpers_AssetHelper();
$viewRenderer->view->css = new Joobsbox_Helpers_CssHelper();
$viewRenderer->view->js = new Joobsbox_Helpers_JsHelper();
$viewRenderer->view->addScriptPath(APPLICATION_DIRECTORY . '/themes/core/views/scripts');
$viewRenderer->view->addScriptPath(APPLICATION_DIRECTORY . '/themes/' . $theme . '/views/scripts');
$viewRenderer->view->setEncoding("UTF-8");
$viewRenderer->view->addHelperPath(APPLICATION_DIRECTORY . '/Joobsbox/Helpers', "Joobsbox_Helpers");
$conf = Zend_Registry::get("conf");
Zend_Registry::set("theme", $theme);
$viewRenderer->view->conf = $conf;
if ($conf->general->standalone) {
if ($layout = Zend_Layout::getMvcInstance()) {
$layout->setLayoutPath(APPLICATION_DIRECTORY . $layoutPath);
$layout->setLayout($layoutName);
} else {
Zend_Layout::startMvc(array('layoutPath' => APPLICATION_DIRECTORY . $layoutPath, 'layout' => $layoutName));
}
}
}
示例5: testHelperMethodFetchesLayoutObject
public function testHelperMethodFetchesLayoutObject()
{
$layout = Zend_Layout::startMvc();
$helper = new Zend_View_Helper_Layout();
$received = $helper->layout();
$this->assertSame($layout, $received);
}
示例6: routeShutdown
public function routeShutdown(Zend_Controller_Request_Abstract $request)
{
//starten des Zend_Layouts
$layout = Zend_Layout::startMvc(array('layoutPath' => '../application/modules/default/views/layouts'));
$contollerName = $request->getControllerName();
$modulName = $request->getModuleName();
if ($contollerName == 'make' and $modulName == 'annotation' or $contollerName == 'browse' and $modulName == 'annotation' and $request->getActionName() != 'index') {
$layout->disableLayout();
//setLayout('flexlayout');
} elseif ($modulName == 'service') {
$layout->disableLayout();
} elseif ($modulName == 'image' and $contollerName == 'index') {
$layout->disableLayout();
} else {
$layout->setLayout('layout');
}
// der view Voreinstellungen übergeben
$view = $layout->getView();
$view->doctype('XHTML1_TRANSITIONAL');
$view->headLink(array('href' => '/styles/index.css', 'rel' => 'stylesheet', 'type' => 'text/css', 'media' => 'screen'));
$view->headLink(array('href' => '/images/website/favicon.ico', 'rel' => 'shortcut icon'));
$view->headTitle(Zend_Registry::get('APP_NAME'));
//??$view->headMeta()->appendName('http-equiv','text/html; charset=utf-8');
// register the MESSAGE key
$registry = Zend_Registry::getInstance();
$registry->MESSAGE = '';
}
示例7: indexAction
public function indexAction()
{
$translate = Zend_Registry::get('Zend_Translate');
$this->view->title = 'Thống kê tháng - ' . $translate->_('TEXT_DEFAULT_TITLE');
$this->view->headTitle($this->view->title);
$layoutPath = APPLICATION_PATH . '/templates/' . TEMPLATE_USED;
$option = array('layout' => '1_column/layout', 'layoutPath' => $layoutPath);
Zend_Layout::startMvc($option);
$date = new Zend_Date();
$date->subMonth(1);
$thang = $this->_getParam('thang', $date->toString("M"));
$nam = $this->_getParam('nam', $date->toString("Y"));
$auth = Zend_Auth::getInstance();
$identity = $auth->getIdentity();
$em_id = $identity->em_id;
$holidaysModel = new Front_Model_Holidays();
$list_holidays = $holidaysModel->fetchData(array(), 'hld_order ASC');
$xinnghiphepModel = new Front_Model_XinNghiPhep();
$list_nghi_phep = $xinnghiphepModel->fetchByDate($em_id, "{$nam}-{$thang}-01 00:00:00", "{$nam}-{$thang}-31 23:59:59");
$chamcongModel = new Front_Model_ChamCong();
$cham_cong = $chamcongModel->fetchOneData(array('c_em_id' => $em_id, 'c_thang' => $thang, 'c_nam' => $nam));
$khenthuongModel = new Front_Model_KhenThuong();
$khen_thuong = $khenthuongModel->fetchByDate($em_id, "{$nam}-{$thang}-01 00:00:00", "{$nam}-{$thang}-31 23:59:59");
$kyluatModel = new Front_Model_KyLuat();
$ky_luat = $kyluatModel->fetchByDate($em_id, "{$nam}-{$thang}-01 00:00:00", "{$nam}-{$thang}-31 23:59:59");
$this->view->cham_cong = $cham_cong;
$this->view->thang = $thang;
$this->view->nam = $nam;
$this->view->list_holidays = $list_holidays;
$this->view->list_nghi_phep = $list_nghi_phep;
$this->view->khen_thuong = $khen_thuong;
$this->view->ky_luat = $ky_luat;
}
示例8: init
public function init()
{
//Duong dan den layout
$option = array('layout' => 'layout', 'layoutPath' => LAYOUT_PATH . '/tmpdaugia');
Zend_Layout::startMvc($option);
$this->_SESSION = new Zend_Session_Namespace();
}
示例9: init
public function init()
{
Zend_Layout::startMvc(array('layoutPath' => APPLICATION_PATH . '/admin/layouts', 'layout' => 'layout'));
$this->db = Zend_Db_Table::getDefaultAdapter();
$this->user = new Application_Model_User();
$this->baseurl = Zend_Controller_Front::getInstance()->getBaseUrl();
//actual base url function
$this->language_id = Zend_Registry::get('lang_id');
//get the instance of database adapter
$this->user_session = new Zend_Session_Namespace("user_session");
// default namespace
$this->filter = new Zend_Filter_StripTags();
//Zend_Registry::set('lang_id',2);
ini_set("max_execution_time", 0);
$auth = Zend_Auth::getInstance();
//if not loggedin redirect to login page
if (!$auth->hasIdentity()) {
$this->_redirect('/admin/index/login');
}
/* if(isset($this->user_session->role_id)){
$role = array('1' => 'Admin','2' => 'Payment Manager','3' => 'Content Manager','4' => 'Listing Manager', '3' => 'Deals Manager' );
$this->view->user = array(
'user_id' => $this->user_session->user_id,
'email' => $this->user_session->email,
'role_id' => $this->user_session->role_id,
'role_name' => $role[$this->user_session->role_id],
'user_name' =>$this->user_session->firstname,
);
} */
}
示例10: start
function start($environment = "dev")
{
try {
require_once 'Zend/Loader/PluginLoader.php';
Zend_Loader::registerAutoload();
# Inicializa o Config
$fConfig = new Zend_Config_Ini($this->_basepath . "/application/config/config.ini", $environment);
# start a session app
Zend_Session::start();
# load env data
$db = $fConfig->application->db;
# Register the session
Zend_Registry::set("db", $db);
# start the front
$front = Zend_Controller_Front::getInstance();
//Set the Layout
Zend_Layout::startMvc(array("layoutPath" => $this->_basepath . "/application/layout/"));
$front->throwExceptions(true);
$front->setParam('noViewRendred', true);
$front->setParam('noErrorHandler', true);
$front->setControllerDirectory($this->_basepath . "/application/modules/default/controllers/");
$front->dispatch();
} catch (Exception $e) {
$contentType = "text/html";
header("Content-Type: {$contentType}; charset=utf-8");
var_dump($e->getMessage());
}
}
示例11: init
/**
* Reescreve o método init()
* @access public
* @param void
* @return void
*/
public function init()
{
// configurações do layout padrão
Zend_Layout::startMvc(array('layout' => 'layout_login'));
parent::init();
// chama o init() do pai GenericControllerNew
}
示例12: init
public function init()
{
//$option = array('layout' => 'layout', 'layoutPath' => LAYOUT_PATH . '/' . $page->templates);
//Duong dan den layout
$option = array('layout' => 'layout', 'layoutPath' => LAYOUT_PATH . '/tmpstore');
Zend_Layout::startMvc($option);
}
示例13: init
function init()
{
@session_start();
if (isset($_SESSION['role_id']))
{
$layoutPath = APPLICATION_PATH . '/templates/admin';
$option = array ('layout' => 'index',
'layoutPath' => $layoutPath );
Zend_Layout::startMvc ( $option );
$this->mDiachi = new Admin_Model_Mdiachi();
if(isset($_SESSION['role']))
$this->role = $_SESSION['role'];
else {
$this->_redirect($this->view->baseUrl().'/../admin');
}
if(isset($_SESSION['user_id']))
$this->user_id = $_SESSION['user_id'];
else {
$this->_redirect($this->view->baseUrl().'/../admin');
}
$_SESSION["backend_current_menu"]="menu-diachilienket";
}
else $this->_redirect($this->view->baseUrl().'/../admin');
}
示例14: indexAction
public function indexAction()
{
$translate = Zend_Registry::get('Zend_Translate');
$this->view->title = 'Danh sách thành viên - ' . $translate->_('TEXT_DEFAULT_TITLE');
$this->view->headTitle($this->view->title);
$layoutPath = APPLICATION_PATH . '/templates/' . TEMPLATE_USED;
$option = array('layout' => 'donvi/layout', 'layoutPath' => $layoutPath);
Zend_Layout::startMvc($option);
$auth = Zend_Auth::getInstance();
$identity = $auth->getIdentity();
$em_id = $identity->em_id;
$emModel = new Front_Model_Employees();
$phongbanModel = new Front_Model_Phongban();
$my_info = $emModel->fetchRow('em_id=' . $em_id . ' and em_status=1');
$phong_ban_id = $list_phongban = $phong_ban = array();
if ($my_info) {
$phong_ban_id[] = $my_info->em_phong_ban;
$list_phongban = $phongbanModel->fetchDataStatus($my_info->em_phong_ban, $phong_ban);
}
if (sizeof($list_phongban)) {
foreach ($list_phongban as $phong_ban_info) {
$phong_ban_id[] = $phong_ban_info->pb_parent;
}
}
//$phong_ban_id = implode(',', $phong_ban_id);
$list_nhan_vien = $emModel->getListNhanVienTheoChucVu($phong_ban_id);
$this->view->list_nhan_vien = $list_nhan_vien;
}
示例15: preDispatch
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$module = $request->getModuleName();
$module = "admin";
$options = array('layoutPath' => BASE_PATH . DIRECTORY_SEPARATOR . 'layouts' . DIRECTORY_SEPARATOR . $module);
Zend_Layout::startMvc()->setLayoutPath($options);
}