示例#1
0
 /**
  * Create a HTML button element.
  *
  * @param  string  $name
  * @param  string  $value
  * @param  array   $attributes
  * @return string
  */
 public static function button($value, $attributes = array())
 {
     return '<button' . HTML::attributes($attributes) . '>' . HTML::entities($value) . '</button>' . PHP_EOL;
 }
示例#2
0
 /**
  * Generate an image tag
  *
  * @param string $file The file relative to your public directory
  * @param string $alt The HTML alt attribute
  * @param string $params Additional HTML attributes
  *
  * @return string
  */
 public function image($file, $alt = '', $params = '')
 {
     $attrs = array();
     if (strlen(trim($params)) != 0) {
         parse_str($params, $attrs);
     }
     $attrs['alt'] = $alt;
     if (strtolower(substr($file, 0, 4)) == 'http') {
         $url = $file;
     } else {
         $url = asset($file);
     }
     return '<img src="' . HTML::entities($url) . '"' . HTML::attributes($attrs) . '>';
 }
示例#3
0
 protected function link($page, $text, $class)
 {
     $query = '?page=' . $page . $this->appendage($this->appends);
     return '<li' . HTML::attributes(array('class' => $class)) . '>' . HTML::link(URI::current() . $query, $text, array(), Request::secure()) . '</li>';
 }