コード例 #1
0
 /**
  * Renders HTML code for custom tab.
  *
  * @return string
  */
 public function getTab()
 {
     $img = Html::el('img', ['height' => 16, 'width' => 16])->src('data:image/svg+xml;base64,' . base64_encode(file_get_contents(__DIR__ . '/logo.svg')));
     $tab = Html::el('span')->title('Features')->addHtml($img);
     $features = $this->toggler->getFeatures();
     $title = Html::el()->setText(sprintf('Features (%d)', count($features)));
     return (string) $tab->addHtml($title);
 }
コード例 #2
0
 public function enabled($feature, $context = [])
 {
     return $this->toggler->enabled($feature, $context);
 }