public static function panelCallback(Tag $tag) { if (!isset(static::$configurations['panel']) && !isset(static::$configurations['panel']['options'])) { return; } foreach (static::$configurations['panel']['options'] as $key => $class) { if ($key == 'Default') { continue; } if ($tag->hasClass($class)) { return; } } $tag->addClass('panel-default'); }
public static function tabsFactory($config, $args) { $tag = Tag::create($config['tagName']); foreach ($config['attributes'] as $name => $value) { $tag->{$name}($value); } foreach ($args as $index => $arg) { $options = array(); $link_to = '#'; $text = 'Menu' . $index; if (!is_array($arg)) { $text = $arg; } else { if ($arg[0]) { $text = $arg[0]; } if ($arg[1]) { $link_to = $arg[1]; } if ($arg[2]) { $options['class'] = 'active'; } } $tag->append(Tag::li($options, Tag::a(array('href' => $link_to), $text))); } return $tag; }
public static function tableResponsiveFactory(array $config, array $args) { $tagName = $config['tagName']; $attributes = $config['attributes']; if (isset($args[0])) { $attributes['src'] = $args[0]; } if (isset($args[1])) { $attributes['alt'] = $args[1]; } $tag = static::create($tagName, $attributes); foreach (array_slice($args, 2) as $arg) { $tag->append($arg); } $tag->activeElement = TwitterBootstrap::table(); $tag->append($tag->activeElement); return $tag; }
public function testChaincase() { $this->assertEquals('test-case', Tag::_chaincase('testCase')); $this->assertEquals('super-test-case', Tag::_chaincase('superTestCase')); $this->assertEquals('third-test-case', Tag::_chaincase('ThirdTestCase')); }
public function navbarToggleCallback() { $this->append(Tag::span('Toggle navigation')->class('sr-only'))->append(Tag::span()->class('icon-bar'))->append(Tag::span()->class('icon-bar'))->append(Tag::span()->class('icon-bar')); }
public static function alertCallback(Tag $tag) { if ($tag->hasClass('alert-dismissable')) { $tag->prepend(Tag::button(array('type' => 'button', 'class' => 'close', 'data-dismiss' => 'alert', 'area-hidden' => 'true'))->appendHtml('×')); } }
protected function setUp() { Tag::$codeFormat = false; }