Beispiel #1
0
 /**
  * @group Panels
  */
 public final function ContentPanelFullMonty()
 {
     $panel = ContentPanel::create(Paragraph::create('Content panel and header with everything'));
     $panel->appendContent(Paragraph::create('appended content'));
     $panel->prependContent(Paragraph::create('prepended content'));
     $header = PanelHeader::create('Panel Header with everything');
     $header->setStatus($header::STATUS_CLOSED);
     $header->addIcon();
     $header->setBgColour($header::BG_SUCCESS);
     $header->setActions([new Link('#', 'Action 1'), new Link('#', 'Action 2'), new Link('#', 'Action 3'), new Link('#', 'Action 4'), new Link('#', 'Action 5')]);
     return $panel->setHeader($header);
 }
Beispiel #2
0
 /**
  * $content can be of type String or PanelHeader
  *
  * @param $content
  *
  * @return $this
  * @throws \Exception
  */
 public function setHeader($content)
 {
     if ($content instanceof PanelHeader) {
         $this->_header = $content;
     } else {
         if (is_scalar($content)) {
             $this->_header = PanelHeader::create($content);
         } else {
             if (is_array($content)) {
                 $this->_header = PanelHeader::create($content);
             }
         }
     }
     return $this;
 }