/**
  * @method TwitterBootstrap lead()
  * @method TwitterBootstrap textLeft()
  * @method TwitterBootstrap textCenter()
  * @method TwitterBootstrap textRight()
  * @method TwitterBootstrap textMuted()
  * @method TwitterBootstrap textPrimary()
  * @method TwitterBootstrap textSuccess()
  * @method TwitterBootstrap textInfo()
  * @method TwitterBootstrap textWarning()
  * @method TwitterBootstrap textDanger()
  *
  * @param string $name
  * @param array $args
  * @return Tag
  */
 public function __call($name, $args)
 {
     $pattern = array('lead' => 'lead', 'textLeft' => 'text-left', 'textCenter' => 'text-center', 'textRight' => 'text-right', 'textMuted' => 'text-muted', 'textPrimary' => 'text-primary', 'textSuccess' => 'text-success', 'textInfo' => 'text-info', 'textWarning' => 'text-warning', 'textDanger' => 'text-danger');
     if (array_key_exists($name, $pattern)) {
         return $this->addClass($pattern[$name]);
     }
     return parent::__call($name, $args);
 }
Beispiel #2
0
 protected function setUp()
 {
     Tag::$codeFormat = false;
 }
Beispiel #3
0
 public function testAppendTagWithContent()
 {
     $this->nodes->append(Tag::strong('content'));
     $this->assertEquals((string) $this->nodes, '<strong>content</strong>');
     $this->assertEquals((string) $this->nodes->append(array(Tag::br(), 'append text')), '<strong>content</strong><br>append text');
 }
Beispiel #4
0
 public function testParent()
 {
     $root = Tag::div()->id('root');
     $this->assertNull($root->getParent());
     $root->append($second = Tag::div()->id('second'));
     $this->assertEquals('<div id="second"></div>', (string) $second);
     $this->assertEquals('<div id="root"><div id="second"></div></div>', (string) $second->close());
     $second->append($third = Tag::div()->id('third'));
     $this->assertEquals('<div id="third"></div>', (string) $third);
     $this->assertEquals('<div id="second"><div id="third"></div></div>', (string) $third->close());
     $this->assertEquals('<div id="root"><div id="second"><div id="third"></div></div></div>', (string) $third->end());
 }