当前位置: 首页>>代码示例>>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;未经允许,请勿转载。