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