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


PHP Zend_Layout::assign方法代碼示例

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


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

示例1: create

 /**
  * Implementation \Extlib\Mail\Message\MessageInterface::create()
  * 
  * @param string $template
  * @return string|html 
  */
 public function create($template = null)
 {
     if (null !== $template) {
         $this->setScriptName($template);
     }
     $this->layout->assign('content', $this->layout->getView()->render($this->getScript()));
     return $this->layout->render();
 }
開發者ID:lciolecki,項目名稱:zf-extensions-library,代碼行數:14,代碼來源:Html.php

示例2: _buildTextBody

 /**
  * Build the txt part of the email using the provided scripts
  *
  * @return void
  */
 private function _buildTextBody()
 {
     $viewContent = '';
     if ($this->getTxtView()) {
         $viewContent = $this->view->render($this->getTxtView());
         if (!$this->getTxtLayout()) {
             // no layout, render only the view
             $this->setBodyText($viewContent);
         }
     }
     if ($this->getTxtLayout()) {
         $this->_layout->setLayout($this->getTxtLayout());
         $this->_layout->setView($this->view);
         // assign rendered view to the layout
         $this->_layout->assign('content', $viewContent);
         // render the layout
         $this->setBodyText($this->_layout->render($this->getTxtLayout()));
     }
 }
開發者ID:JellyBellyDev,項目名稱:zle,代碼行數:24,代碼來源:Mvc.php

示例3: render

 private function render()
 {
     if ($this->messagesExist) {
         $this->layout = $this->getLayout();
         $messages = $this->messages;
         $tmp = [];
         foreach ($messages as $messageType => $values) {
             if (count($values) > 0) {
                 if ($messageType == self::TYPE_CONFIRMATION) {
                     $messageType = 'success';
                 } elseif ($messageType == self::TYPE_DEBUG) {
                     $messageType = 'information';
                 } elseif ($messageType == self::TYPE_NOTICE) {
                     $messageType = 'alert';
                 }
                 $tmp[$messageType] = $values;
             }
         }
         $this->layout->assign('messages', json_encode($tmp));
         $this->resetMessages();
     }
 }
開發者ID:dafik,項目名稱:dfi,代碼行數:22,代碼來源:Messages.php

示例4: assign

 /**
  * Assign value for view
  * 
  * @param string $spec     Variable which is used in view
  * @param string $value    Value of variable
  * 
  * @return Vi_Layout
  */
 public function assign($spec, $value = null)
 {
     $this->_view->assign($spec, $value);
     parent::assign($spec, $value);
     return $this;
 }
開發者ID:judasnow,項目名稱:qspread20101020,代碼行數:14,代碼來源:Layout.php

示例5: testAssignWithArrayPopulatesPropertiesAccessibleViaOverloading

 /**
  * @return void
  */
 public function testAssignWithArrayPopulatesPropertiesAccessibleViaOverloading()
 {
     $layout = new Zend_Layout();
     $layout->assign(array('foo' => 'bar', 'bar' => 'baz'));
     $this->assertEquals('bar', $layout->foo);
     $this->assertEquals('baz', $layout->bar);
 }
開發者ID:hjr3,項目名稱:zf2,代碼行數:10,代碼來源:LayoutTest.php


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