/** * Create a new Link * * @param string $link The link href * @param string $value The link's text * @param array $attributes * * @return Link */ public function __construct($link = '#', $value = null, $attributes = array()) { if (static::$urlGenerator) { $link = static::$urlGenerator->to($link); } if (is_null($value)) { $value = $link; } $attributes['href'] = $link; $this->setTag('a', $value, $attributes); }
/** * Change the form's action * * @param string $action The new action * * @return $this */ public function action($action) { $this->action = $action ? $this->url->to($action, array(), $this->secure) : null; return $this; }
/** * Returns a redirect response. * * @param string $url * @param array $parameters * @param int $status * @param array $headers * @return RedirectResponse */ public function redirect($url, $parameters = array(), $status = 302, $headers = array()) { return new RedirectResponse($this->url->to($url, $parameters), $status, $headers); }