本文整理匯總了PHP中BlockView::setController方法的典型用法代碼示例。如果您正苦於以下問題:PHP BlockView::setController方法的具體用法?PHP BlockView::setController怎麽用?PHP BlockView::setController使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類BlockView
的用法示例。
在下文中一共展示了BlockView::setController方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: render
/**
* Renders a view in the block's folder.
* <code>
* public function view() { // The view() method is automatically run when a block is viewed
* $this->render("other_special_view"); // don't use .php
* }
* </code>
* @param string $view
* @return void
*/
function render($view)
{
$bv = new BlockView();
$bv->setController($this);
// sometimes we need the block type available in here
if (is_object($this->getBlockObject())) {
$bt = BlockType::getByID($this->getBlockObject()->getBlockTypeID());
$a = $this->getBlockObject()->getBlockAreaObject();
}
$this->renderOverride = $view;
}
示例2: render
/**
* Renders a particular view of a block type, using the public $controller variable as the block type's controller
* @param string template 'view' for the default
* @return void
*/
public function render($view = 'view') {
$bv = new BlockView();
$bv->setController($this->controller);
$bv->render($this, $view);
}