Exemplo n.º 1
0
Arquivo: HTML.php Projeto: rcrowe/html
 /**
  * Generate an HTML image element.
  *
  * @param  string $url
  * @param  string $alt
  * @param  array  $attributes
  * @return string
  */
 public function image($url, $alt = null, $attributes = array())
 {
     if (is_null($alt)) {
         $alt = $url;
     }
     $attributes['alt'] = $alt;
     return '<img src="' . $this->url->to($url) . '"' . $this->attributes($attributes) . '>';
 }
Exemplo n.º 2
0
 /**
  * Create a new redirect response.
  *
  * @param  string  $path
  * @param  int     $status
  * @param  array   $headers
  * @return Illuminate\Http\RedirectResponse
  */
 protected function createRedirect($path, $status, $headers)
 {
     $redirect = new RedirectResponse($path, $status, $headers);
     if (isset($this->session)) {
         $redirect->setSession($this->session);
     }
     $redirect->setRequest($this->generator->getRequest());
     return $redirect;
 }
Exemplo n.º 3
0
 /**
  * Generate a url for the application.
  *
  * @param  string  $path
  * @param  mixed   $parameters
  * @param  bool    $secure
  * @return string
  */
 function url($path = null, $parameters = [], $secure = null)
 {
     $routes = new Illuminate\Routing\RouteCollection();
     $context = Illuminate\Http\Request::createFromBase(Illuminate\Http\Request::capture());
     $generator = new Illuminate\Routing\UrlGenerator($routes, $context);
     return $generator->to($path, $parameters, $secure);
 }