• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Zend_Layout类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: sendEmail

 public function sendEmail($template, $to, $subject, $params = array())
 {
     try {
         $config = array('auth' => 'Login', 'port' => $this->_bootstrap_options['mail']['port'], 'ssl' => 'ssl', 'username' => $this->_bootstrap_options['mail']['username'], 'password' => $this->_bootstrap_options['mail']['password']);
         $tr = new Zend_Mail_Transport_Smtp($this->_bootstrap_options['mail']['server'], $config);
         Zend_Mail::setDefaultTransport($tr);
         $mail = new Zend_Mail('UTF-8');
         $layout = new Zend_Layout();
         $layout->setLayoutPath($this->_bootstrap_options['mail']['layout']);
         $layout->setLayout('email');
         $view = $layout->getView();
         $view->domain_url = $this->_bootstrap_options['site']['domainurl'];
         $view = new Zend_View();
         $view->params = $params;
         $view->setScriptPath($this->_bootstrap_options['mail']['view_script']);
         $layout->content = $view->render($template . '.phtml');
         $content = $layout->render();
         $mail->setBodyText(preg_replace('/<[^>]+>/', '', $content));
         $mail->setBodyHtml($content);
         $mail->setFrom($this->_bootstrap_options['mail']['from'], $this->_bootstrap_options['mail']['from_name']);
         $mail->addTo($to);
         $mail->setSubject($subject);
         $mail->send();
     } catch (Exception $e) {
         // 这里要完善
     }
     return true;
 }
开发者ID:ud223,项目名称:yj,代码行数:28,代码来源:Email.php


示例2: generateLayout

 /**
  * Tạo Object Layout cho Email
  */
 private function generateLayout()
 {
     $layout = new Zend_Layout();
     $layout->setLayoutPath(APPLICATION_PATH . 'modules/admin/views/scripts/email');
     $layout->setLayout('layout');
     return $layout;
 }
开发者ID:hoaitn,项目名称:base-zend,代码行数:10,代码来源:Email.php


示例3: __construct

 private function __construct()
 {
     // setup file error logging
     $file_writer = new Logger_Errorlog();
     if (Config::get_optional("DEBUG_LOG") == false) {
         $file_writer->addFilter(Zend_Log::INFO);
     }
     $log = new Zend_Log();
     $log->addWriter($file_writer);
     // setup email error logging
     if (Config::get_optional("log_to_email") == true) {
         $mail = new Zend_Mail();
         $mail->setFrom(Config::get_mandatory('log_email_from'));
         $mail->addTo(Config::get_mandatory('log_email_to'));
         // setup email template
         $layout = new Zend_Layout();
         $layout->setLayoutPath(DOCUMENT_ROOT . Config::get_mandatory("log_email_template"));
         $layout->setLayout('error-logger');
         $layout_formatter = new Zend_Log_Formatter_Simple('<li>.' . Zend_Log_Formatter_Simple::DEFAULT_FORMAT . '</li>');
         // Use default HTML layout.
         $email_writer = new Zend_Log_Writer_Mail($mail, $layout);
         $email_writer->setLayoutFormatter($layout_formatter);
         $email_writer->setSubjectPrependText(Config::get_mandatory('log_email_subject_prepend'));
         $email_writer->addFilter(Zend_Log::ERR);
         $log->addWriter($email_writer);
     }
     self::$logger = $log;
 }
开发者ID:ThibautLeger,项目名称:123-mini,代码行数:28,代码来源:Logger.php


示例4: _initLayout

 /**
  * Инициализация объекта Layout
  * 
  * @return Phorm_Layout
  */
 protected function _initLayout()
 {
     $layout = new Zend_Layout();
     $layout->setLayoutPath(APPLICATION_PATH . '/templates');
     $layout->setViewSuffix('tpl');
     return $layout;
 }
开发者ID:ei-grad,项目名称:phorm,代码行数:12,代码来源:Bootstrap.php


示例5: setLayout

 public function setLayout(Zend_Layout $layout)
 {
     if ($layout->getMvcEnabled()) {
         throw new InvalidArgumentException();
     }
     $this->_layout = $layout;
     return $this;
 }
开发者ID:sgdoc,项目名称:sgdoce-codigo,代码行数:8,代码来源:Mailer.php


示例6: getLayout

 /**
  * Retorna a instância única de Zend_Layout para auxiliar na construção dos emails.
  *
  * @return Zend_Layout
  */
 public function getLayout()
 {
     static $layout = null;
     if (is_null($layout)) {
         $layout = new Zend_Layout();
         $layout->setLayoutPath(APP_PATH . '/default/views/emails')->setLayout('layout');
     }
     return $layout;
 }
开发者ID:ao-lab,项目名称:ao-zend,代码行数:14,代码来源:Mail.php


示例7: _initLogging

 /**
  * Initialize Logging
  *
  */
 protected function _initLogging()
 {
     $this->bootstrap('log');
     Zend_Registry::set('log', $log = $this->getResource('log'));
     $mail = new Zend_Mail();
     $config = Zend_Registry::get('config');
     $mail->addTo($config->core->debugMailTo);
     $layout = new Zend_Layout();
     $layout->setLayout('errormail');
     $writer = new Zend_Log_Writer_Mail($mail, $layout);
     $writer->setSubjectPrependText('CORE Error');
     $writer->addFilter(Zend_Log::CRIT);
     #$log->addWriter($writer);
 }
开发者ID:br00k,项目名称:tnc-web,代码行数:18,代码来源:Bootstrap.php


示例8: _initView

 protected function _initView()
 {
     $this->bootstrap('EventManager');
     $manager = $this->getResource('EventManager');
     $response = $manager->getResponse();
     $renderer = $response->getRenderer();
     $view = $renderer->getView();
     $view->addScriptPath(dirname(__FILE__) . '/views/scripts');
     $layout = new \Zend_Layout();
     $layout->setLayoutPath(dirname(__FILE__) . '/layouts/scripts');
     $view->getHelper('layout')->setLayout($layout);
     $renderer->setLayout($layout);
     return $view;
 }
开发者ID:jtclark,项目名称:phly,代码行数:14,代码来源:Bootstrap.php


示例9: setViewBody

 public function setViewBody($script, $params = array())
 {
     $layout = new Zend_Layout(array('layoutPath' => $this->_getLayoutPath()));
     $layout->setLayout('email');
     $view = new Zend_View();
     $view->setScriptPath($this->_getViewPath() . '/email');
     foreach ($params as $k => $param) {
         $view->assign($k, $param);
     }
     $layout->content = $view->render($script . '.phtml');
     //$layout->content = $msg;
     $html = $layout->render();
     $this->setBodyHtml($html);
 }
开发者ID:hYOUstone,项目名称:tsg,代码行数:14,代码来源:Model.php


示例10: setBodyView

 public function setBodyView($script, $params = array())
 {
     $layout = new Zend_Layout(array('layoutPath' => APPLICATION_PATH . '/views/layouts'));
     $layout->setLayout('email');
     $view = new Zend_View();
     $view->setScriptPath(APPLICATION_PATH . '/views/email');
     foreach ($params as $key => $value) {
         $view->assign($key, $value);
     }
     $layout->content = $view->render($script . '.phtml');
     $html = $layout->render();
     $this->setBodyHtml($html);
     return $this;
 }
开发者ID:Remchi,项目名称:ZF-Quani,代码行数:14,代码来源:Mail.php


示例11: __invoke

 public function __invoke($message)
 {
     $layout = new Zend_Layout();
     // Установка пути к скриптам макета:
     $layout->setLayoutPath(APPLICATION_PATH . '/views/scripts/layouts');
     $layout->setLayout('inner');
     $view = new Zend_View();
     $view->setBasePath(APPLICATION_PATH . '/views/');
     $view->error_message = $message;
     // установка переменных:
     $layout->content = $view->render('/exeption/user.phtml');
     echo $layout->render();
     //echo $message;
     die;
 }
开发者ID:nurikk,项目名称:EvilRocketFramework,代码行数:15,代码来源:UserMessage.php


示例12: postDispatch

 public function postDispatch()
 {
     $layouts = array_reverse($this->_layouts);
     $mvcLayout = Zend_Layout::getMvcInstance();
     $mvcContentKey = $mvcLayout->getContentKey();
     $content = $this->getResponse()->getBody();
     $view = $this->_cloneView();
     $layout = new Zend_Layout(array('layoutPath' => $mvcLayout->getLayoutPath(), 'viewSuffix' => $mvcLayout->getViewSuffix()));
     $layout->setView($view);
     foreach ($layouts as $layoutName) {
         $layout->setLayout($layoutName);
         $layout->{$mvcContentKey} = $this->getResponse()->getBody();
         $this->getResponse()->setBody($layout->render());
     }
 }
开发者ID:rdallasgray,项目名称:bbx,代码行数:15,代码来源:NestedLayouts.php


示例13: renderMenu

 protected function renderMenu()
 {
     $container = new Zend_Navigation(VAR_menu);
     $this->view->assign('menu', $container);
     $this->view->assign('module', $this->_getParam('module'));
     Zend_Layout::getMvcInstance()->assign('navbar', $this->view->render('navbar.phtml'));
 }
开发者ID:dafik,项目名称:zf-scaffold,代码行数:7,代码来源:ControllerDefaultModule.php


示例14: 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


示例15: getLayout

 /**
  * Retrieve layout object
  *
  * @return Zend_Layout
  */
 public function getLayout()
 {
     if (null === $this->_layout) {
         $this->_layout = Zend_Layout::startMvc($this->getOptions());
     }
     return $this->_layout;
 }
开发者ID:test3metizsoft,项目名称:test,代码行数:12,代码来源:Layout.php


示例16: preDispatch

 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     if ($request->getParam('isAdmin')) {
         $layout = Zend_Layout::getMvcInstance();
         $layout->setLayout('admin');
     }
 }
开发者ID:AkimBolushbek,项目名称:zendframeworkstorefront,代码行数:7,代码来源:AdminContext.php


示例17: 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


示例18: init

 public function init()
 {
     $option = array("layout" => "layout", "layoutPath" => APPLICATION_PATH . "/layouts/scripts/");
     Zend_Layout::startMvc($option);
     $this->sessionGlobal = new Zend_Session_Namespace('username');
     $Sessioonlecturer_id = $this->sessionGlobal->lecturer_id;
 }
开发者ID:phamviet1510,项目名称:giaovu,代码行数:7,代码来源:BaocaoController.php


示例19: postDispatch

 public function postDispatch(Zend_Controller_Request_Abstract $request)
 {
     $layout = Zend_Layout::getMvcInstance();
     // the name "maintenanceMode" is also referred to in the Admin_MaintenanceController,
     // so if you change the filename, it needs to be changed there too
     $maintenanceModeFileName = 'maintenanceMode';
     $register = new Ot_Config_Register();
     $identity = Zend_Auth::getInstance()->getIdentity();
     $role = empty($identity->role) ? $register->defaultRole->getValue() : $identity->role;
     if (isset($identity->masquerading) && $identity->masquerading == true && isset($identity->realAccount) && !is_null($identity->realAccount) && isset($identity->realAccount->role)) {
         $role = $identity->realAccount->role;
     }
     $acl = Zend_Registry::get('acl');
     $view = $layout->getView();
     $viewRenderer = Zend_Controller_Action_HelperBroker::getExistingHelper('ViewRenderer');
     if (is_file(APPLICATION_PATH . '/../overrides/' . $maintenanceModeFileName) && (!$request->isXmlHttpRequest() && !$viewRenderer->getNeverRender())) {
         if (!$acl->isAllowed($role, 'ot_maintenance', 'index')) {
             if (!($request->getModuleName() == 'ot' && $request->getControllerName() == 'login' && $request->getActionName() == 'index')) {
                 $response = $this->getResponse();
                 $layout->disableLayout();
                 $response->setBody($view->maintenanceMode()->publicLayout());
             }
         } else {
             $response = $this->getResponse();
             // there's no point in setting text here if it's a redirect
             if ($response->isRedirect()) {
                 $response->setBody('');
             } else {
                 $response->setBody($view->maintenanceMode()->header() . $response->getBody());
             }
         }
     }
 }
开发者ID:ncsuwebdev,项目名称:otframework,代码行数:33,代码来源:MaintenanceMode.php


示例20: init

	function init()
	{
		@session_start();
		$this->setAccess();
		$_SESSION['home'] = 'home';
		$_SESSION['page'] = 'tintuc';
		$_SESSION['page'] = 'video';
		$this->view->headScript()->appendFile($this->view->baseUrl().'/application/templates/front/js/switch_news.js',"text/javascript");

		$layoutPath = APPLICATION_PATH  . '/templates/front';
		$option = array ('layout' => 'index', 
                   'layoutPath' => $layoutPath );
		Zend_Layout::startMvc ( $option );
		$this->mTimkiem=new Default_Model_Mtimkiem();
		$this->mDefault=new Default_Model_Mdf();
		$this->mTintuc=new Default_Model_Mtintuc();
		$this->mDiachi=new Default_Model_Mdiachi();
		$this->mVideo = new Default_Model_Mvideo();
		$this->mHinhanh = new Default_Model_Mhinhanh();
		$this->view->headScript()->appendFile($this->view->baseUrl().'/application/templates/front/js/switch_news.js',"text/javascript");
		
		$listThreadForum = $this->mDefault->getListThread();
				$this->listThreadTitle = array();
		//var_dump($listThreadForum);die();
		foreach($listThreadForum as $thread)
		{
			$content = file_get_contents('http://localhost/unc/forum/showthread.php?'.$thread['threadid']);
			$preg1 = preg_match_all('#<span class="threadtitle">.*</span>#',$content,$match);
			$this->listThreadTitle[] = $thread['threadid'].strip_tags($match[0][0]);
		}
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:TimkiemController.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Zend_Ldap类代码示例发布时间:2022-05-23
下一篇:
PHP Zend_Json_Encoder类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap