TwigEnvironment

A class that defines a Twig environment for Drupal. Instances of this class are used to store the configuration and extensions, and are used to load templates from the file system or other locations. Hierarchy class \Twig_Environmentclass \Drupal\Core\Template\TwigEnvironment See also core\vendor\twig\twig\lib\Twig\Environment.php File core/lib/Drupal/Core/Template/TwigEnvironment.php, line 16 Namespace Drupal\Core\Template Members Name Modifiers Type Description TwigEnviron

TrustedRedirectResponse::__construct

public TrustedRedirectResponse::__construct($url, $status = 302, $headers = array()) Creates a redirect response so that it conforms to the rules defined for a redirect status code. Parameters string $url The URL to redirect to. The URL should be a full URL, with schema etc.,: but practically every browser redirects on paths only as well int $status The status code (302 by default): array $headers The headers (Location is always set to the given URL): Throws \InvalidArgumentException Override

TrustedRedirectResponse::setTrustedTargetUrl

public TrustedRedirectResponse::setTrustedTargetUrl($url) Sets the target URL to a trusted URL. Parameters string $url: A trusted URL. Return value $this File core/lib/Drupal/Core/Routing/TrustedRedirectResponse.php, line 37 Class TrustedRedirectResponse Provides a redirect response which contains trusted URLs. Namespace Drupal\Core\Routing Code public function setTrustedTargetUrl($url) { $this->trustedUrls[$url] = TRUE; return $this->setTargetUrl($url); }

TrustedRedirectResponse::isSafe

protected TrustedRedirectResponse::isSafe($url) Returns whether the URL is considered as safe to redirect to. Parameters string $url: The URL checked for safety. Return value bool Overrides SecuredRedirectResponse::isSafe File core/lib/Drupal/Core/Routing/TrustedRedirectResponse.php, line 45 Class TrustedRedirectResponse Provides a redirect response which contains trusted URLs. Namespace Drupal\Core\Routing Code protected function isSafe($url) { return !empty($this->trustedUrls[

TrustedRedirectResponse::$trustedUrls

A list of trusted URLs, which are safe to redirect to. Type: string[] File core/lib/Drupal/Core/Routing/TrustedRedirectResponse.php, line 19 Class TrustedRedirectResponse Provides a redirect response which contains trusted URLs. Namespace Drupal\Core\Routing Code protected $trustedUrls = array();

TrustedRedirectResponse

Provides a redirect response which contains trusted URLs. Use this class in case you know that you want to redirect to an external URL. Hierarchy class \Symfony\Component\HttpFoundation\RedirectResponse extends \Symfony\Component\HttpFoundation\Response class \Drupal\Component\HttpFoundation\SecuredRedirectResponseclass \Drupal\Core\Routing\CacheableSecuredRedirectResponse implements CacheableResponseInterface uses CacheableResponseTraitclass \Drupal\Core\Routing\TrustedRedirectResponse uses Lo

TrustedHostsRequestFactory::__construct

public TrustedHostsRequestFactory::__construct($host) Creates a new TrustedHostsRequestFactory. Parameters string $host: The host of the main request. File core/lib/Drupal/Core/Http/TrustedHostsRequestFactory.php, line 35 Class TrustedHostsRequestFactory Provides a request factory for requests using host verification. Namespace Drupal\Core\Http Code public function __construct($host) { $this->host = (string) $host; }

TrustedHostsRequestFactory::createRequest

public TrustedHostsRequestFactory::createRequest(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = NULL) Creates a new request object. Parameters array $query: (optional) The query (GET) or request (POST) parameters. array $request: (optional) An array of request variables. array $attributes: (optioanl) An array of attributes. array $cookies: (optional) The request cookies ($_COOK

TrustedHostsRequestFactory::$host

The host of the main request. Type: string File core/lib/Drupal/Core/Http/TrustedHostsRequestFactory.php, line 27 Class TrustedHostsRequestFactory Provides a request factory for requests using host verification. Namespace Drupal\Core\Http Code protected $host;

TrustedHostsRequestFactory

Provides a request factory for requests using host verification. Because the trusted host patterns for requests are stored statically, they are consulted even for fake request created with Request::create(), whose host is 'localhost' by default. Such requests would fail host verification unless 'localhost' matches one of the trusted host patterns. To circumvent this problem, this factory injects the server variables from the main request into each newly created request, so that the host is corr