'; /** * Sample constructor. * @param string $name * @param string $code */ public function __construct($name = 'sample', $code = '') { $this->name = $name; $this->code = $code; } /** * @return string */ public function __toString() { return $this->getTabs() . $this->getExample(); } protected function createTabs() { return []; } /** * Gets this sample tabs */ protected function getTabs() { $this->tabs = $this->createTabs(); return $this->getTabPills() . $this->getTabContents(); } /** * @return string */ protected function getTabPills() { $result = $this->tabsWrapperStart; foreach ($this->tabs as $tab) { $result .= $tab->getTabPill(); } $result .= $this->tabsWrapperEnd; return $result; } /** * @return string */ protected function getTabContents() { $result = ''; foreach ($this->tabs as $tab) { $result .= $tab->getTabContent(); } return $result; } /** * @return string */ protected function getExample() { return $this->getExampleHtml('', new ImageTag('')); } /** * @param string $url * @param BaseTag $tag * @return string */ protected function getExampleHtml($url, $tag) { return '
' . $tag->addClass('z - depth - 1') . '
'; } protected function createCodeTab() { return new CodeTab($this->code, $this->keepSpaces); } }