예제 #1
0
 public function testDom()
 {
     $html = Html::dom('example', "Lorem Ipsum", array('id' => 'app'));
     $this->assertEquals('<example id="app">Lorem Ipsum</example>', $html);
     $html = Html::dom('br');
     $this->assertEquals('<br />', $html);
 }
예제 #2
0
/**
 * Create dom element
 *
 * @param string $name
 * @param string $text
 * @param array  $attributes
 * @return string
 */
function h($name, $text = '', array $attributes = array())
{
    return Html::dom($name, $text, $attributes);
}
예제 #3
0
파일: Html.php 프로젝트: pagon/framework
 /**
  * Repeat elements
  *
  * @param string $dom
  * @param array  $values
  * @param array  $attributes
  * @return string
  */
 public static function repeat($dom, array $values, array $attributes = null)
 {
     return self::loop($values, function ($value) use($dom, $attributes) {
         return Html::dom($dom, $value, $attributes);
     });
 }