本文整理汇总了PHP中block_manager::add_regions方法的典型用法代码示例。如果您正苦于以下问题:PHP block_manager::add_regions方法的具体用法?PHP block_manager::add_regions怎么用?PHP block_manager::add_regions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类block_manager
的用法示例。
在下文中一共展示了block_manager::add_regions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setup_blocks
/**
* Inform a block_manager about the block regions this theme wants on this
* page layout.
*
* @param string $pagelayout the general type of the page.
* @param block_manager $blockmanager the block_manger to set up.
*/
public function setup_blocks($pagelayout, $blockmanager)
{
$layoutinfo = $this->layout_info_for_page($pagelayout);
if (!empty($layoutinfo['regions'])) {
$blockmanager->add_regions($layoutinfo['regions'], false);
$blockmanager->set_default_region($layoutinfo['defaultregion']);
}
}
示例2: setup_blocks
/**
* Inform a block_manager about the block regions this theme wants on this
* type of page.
* @param string $generaltype the general type of the page.
* @param block_manager $blockmanager the block_manger to set up.
* @return void
*/
public function setup_blocks($generaltype, $blockmanager)
{
// Legacy fallback.
if (empty($this->layouts)) {
if (!in_array($generaltype, array('form', 'popup', 'maintenance'))) {
$blockmanager->add_regions(array(BLOCK_POS_LEFT, BLOCK_POS_RIGHT));
$blockmanager->set_default_region(BLOCK_POS_RIGHT);
}
return;
}
$layoutinfo = $this->layout_info_for_page($generaltype);
if (!empty($layoutinfo['regions'])) {
$blockmanager->add_regions($layoutinfo['regions']);
$blockmanager->set_default_region($layoutinfo['defaultregion']);
}
}