Exemplo n.º 1
0
 public function name($name = NULL)
 {
     if ($name !== NULL) {
         if ($css_attributes = Builder_Html::parse_css_name($name)) {
             $this->_name = $css_attributes['tag'];
             $this->attributes($css_attributes['attributes']);
         } else {
             $this->_name = $name;
         }
         if (!in_array($this->_name, Builder_Html::$tags)) {
             throw new Kohana_Exception('Tag name :name not allowed in HTML 5', array(':name' => $this->_name));
         }
         return $this;
     }
     return $this->_name;
 }
Exemplo n.º 2
0
 /**
  * @dataProvider data_parse_css_name
  */
 public function test_parse_css_name($name, $expected)
 {
     $this->assertEquals($expected, Builder_Html::parse_css_name($name));
 }