/**
  * @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>';
 }
Пример #2
0
 public function testDecoratorParams()
 {
     $params = new DecoratorParams('sample_type', ['key1' => 'val1']);
     $this->assertEquals('sample_type', $params->getPlugin());
     $params->setPlugin('sample_type2');
     $this->assertEquals('sample_type2', $params->getPlugin());
     $this->assertEquals($params->key1, 'val1');
     $params->key2 = 'val2';
     $this->assertEquals('val2', $params->key2);
     $params->set('key3', 'val3');
     $this->assertEquals('val3', $params->__get('key3'));
 }