本文整理匯總了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);
}