當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Layout::setLayoutPath方法代碼示例

本文整理匯總了PHP中Zend_Layout::setLayoutPath方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Layout::setLayoutPath方法的具體用法?PHP Zend_Layout::setLayoutPath怎麽用?PHP Zend_Layout::setLayoutPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Layout的用法示例。


在下文中一共展示了Zend_Layout::setLayoutPath方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _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

示例2: _setLayout

 protected function _setLayout()
 {
     if (null === self::$_layout) {
         self::$_layout = Zend_Layout::startMvc();
         self::$_layout->setLayoutPath(SP_APP_PATH . DIRECTORY_SEPARATOR . 'layouts')->setLayout('layout');
     }
 }
開發者ID:victorli,項目名稱:ShrimpProject,代碼行數:7,代碼來源:Application.php

示例3: _prepareLayout

 /**
  * Prepare layout instance to be used
  *
  * @return void
  */
 private function _prepareLayout()
 {
     // set the view object
     $this->_layout->setView($this->view);
     // set the layout path
     $this->_layout->setLayoutPath($this->getApplicationPath() . '/layouts/scripts/');
 }
開發者ID:JellyBellyDev,項目名稱:zle,代碼行數:12,代碼來源:Mvc.php

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

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

示例6: __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

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

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

 /**
  * Layout getter. If it does not exist it create a new one.
  * @return Zend_Layout
  */
 public function getLayout()
 {
     if (!isset($this->_layout)) {
         $this->_layout = new Zend_Layout();
         if (Zend_Layout::getMvcInstance() !== null) {
             $path = Zend_Layout::getMvcInstance()->getLayoutPath() . DIRECTORY_SEPARATOR . self::DEFAULT_DIR;
             $this->_layout->setLayoutPath($path);
         } else {
             $this->_layout->setLayoutPath(self::getDefaultOptions('layoutPath'));
         }
         $this->_layout->setView($this->getView());
     }
     return $this->_layout;
 }
開發者ID:SandeepUmredkar,項目名稱:PortalSMIP,代碼行數:18,代碼來源:Mail.php

示例10: __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

示例11: startMvc

 /**
  * Static method for initialization with MVC support
  * 
  * @param  string|array|Zend_Config $options 
  * @return Zend_Layout
  */
 public static function startMvc($options = null)
 {
     if (null === self::$_mvcInstance) {
         self::$_mvcInstance = new self($options, true);
     } elseif (is_string($options)) {
         self::$_mvcInstance->setLayoutPath($options);
     } else {
         self::$_mvcInstance->setOptions($options);
     }
     return self::$_mvcInstance;
 }
開發者ID:jcvpalma,項目名稱:avaliacao_desenv_php_zend17,代碼行數:17,代碼來源:Layout.php

示例12: testRenderWithCustomInflection

 public function testRenderWithCustomInflection()
 {
     $layout = new Zend_Layout();
     $view = new Zend_View();
     $layout->setLayoutPath(dirname(__FILE__) . '/_files/layouts')->setView($view);
     $inflector = $layout->getInflector();
     $inflector->setTarget('test/:script.:suffix')->setStaticRule('suffix', 'php');
     $layout->message = 'Rendered layout';
     $received = $layout->render();
     $this->assertContains('Testing layouts with custom inflection:', $received);
     $this->assertContains($layout->message, $received);
 }
開發者ID:hjr3,項目名稱:zf2,代碼行數:12,代碼來源:LayoutTest.php

示例13: _bootstrapLayout

 protected function _bootstrapLayout()
 {
     $layout = new Zend_Layout();
     // Set a layout script path:
     $layout->setLayoutPath(ENGINEBLOCK_FOLDER_APPLICATION . 'layouts/scripts/');
     // Defaults
     $defaultsConfig = $this->_application->getConfiguration()->defaults;
     $layout->title = $defaultsConfig->title;
     $layout->header = $defaultsConfig->header;
     // choose a different layout script:
     $layout->setLayout($defaultsConfig->layout);
     $this->_application->setLayout($layout);
 }
開發者ID:WebSpider,項目名稱:OpenConext-engineblock,代碼行數:13,代碼來源:Bootstrapper.php

示例14: _getMailLayout

 protected function _getMailLayout()
 {
     $layout = new Zend_Layout();
     $layout->setLayoutPath(ENGINEBLOCK_FOLDER_APPLICATION . 'layouts/scripts');
     $layout->setLayout('error-mail');
     return $layout;
 }
開發者ID:newlongwhitecloudy,項目名稱:OpenConext-engineblock,代碼行數:7,代碼來源:Mail.php


注:本文中的Zend_Layout::setLayoutPath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。