/** * @param BlockController $block * @param DecoratorParams $params * * @return mixed */ public function render(BlockController $block, DecoratorParams $params) { $title = $block->getTitle(); $header = ''; if ($title) { $header = '<div class="panel-header"><div class="panel-header"><span>' . $title . '</span></div></div>'; } return '<div class="panel ' . $params->get('scheme') . ' ' . $block->getCssClassName() . '">' . $header . '<div class="panel-body">' . $block->getContent() . '</div></div>'; }
/** * @param BlockController $block * @param DecoratorParams $params * * @return mixed */ public function render(BlockController $block, DecoratorParams $params) { $title = $block->getTitle(); $header = ''; if ($title) { $header = '<div class="unit-header"><div class="unit-title"><span>' . $title . '</span></div></div>'; } return '<div class="unit ' . $block->getCssClassName() . '">' . $header . '<div class="unit-content">' . $block->getContent() . '</div></div>'; }
public function testBlock() { $block = new BlockController(); $block->setIcon('sample_icon'); $this->assertEquals('sample_icon', $block->getIcon()); $block->setTitle('sample_title'); $this->assertEquals('sample_title', $block->getTitle()); $block->setBadge('4'); $this->assertEquals('4', $block->getBadge()); $this->assertEquals('kendo-layout', $block->getCssClassName()); $block->setNoRender(false); $this->assertFalse($block->isNoRender()); $block->setNoRender(true); $this->assertTrue($block->isNoRender()); }