Exemple #1
0
 /**
  * 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) . '>';
 }
 /**
  * Create a new redirect response to the given path.
  *
  * @param  string  $path
  * @param  int     $status
  * @param  array   $headers
  * @param  bool    $secure
  * @return Illuminate\Http\RedirectResponse
  */
 public function to($path, $status = 302, $headers = array(), $secure = null)
 {
     $path = $this->generator->to($path, array(), $secure);
     return $this->createRedirect($path, $status, $headers);
 }
Exemple #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);
 }