本文整理汇总了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();
}
示例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()));
}
}
示例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();
}
}
示例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;
}
示例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);
}