本文整理匯總了PHP中Block::getName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Block::getName方法的具體用法?PHP Block::getName怎麽用?PHP Block::getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Block
的用法示例。
在下文中一共展示了Block::getName方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: removeBlock
/**
* Remove block from composition
*
* @param Block $blockToRemove
*/
public function removeBlock(Block $blockToRemove)
{
foreach ($this->blocks as $key => $block) {
if ($block->getName() === $blockToRemove->getName()) {
unset($this->blocks[$key]);
}
}
}
示例2: renderBlocks
private function renderBlocks()
{
$this->aRenderedBlocks = array();
foreach ($this->aBlocks as $sBlock) {
// New block object
$oBlock = new Block($sBlock, $this->aPageConfig, $this->sConfigFile);
$this->aRenderedBlocks[$oBlock->getName()] = $oBlock->render();
}
}
示例3: addBlock
public function addBlock(Block $block)
{
$this->blocks[$block->getName()] = $block;
}