class NullGenerator

No-op implementation of a Url Generator, needed for backward compatibility.

Hierarchy

Expanded class hierarchy of NullGenerator

1 string reference to 'NullGenerator'
core.services.yml in drupal/core/core.services.yml
drupal/core/core.services.yml
1 service uses NullGenerator

File

drupal/core/lib/Drupal/Core/Routing/NullGenerator.php, line 17
Contains Drupal\Core\Routing\NullGenerator.

Namespace

Drupal\Core\Routing
View source
class NullGenerator extends UrlGenerator {

  /**
   * Override the parent constructor.
   */
  public function __construct() {
  }

  /**
   * Overrides Drupal\Core\Routing\UrlGenerator::generate();
   */
  public function generate($name, $parameters = array(), $absolute = FALSE) {
    throw new RouteNotFoundException();
  }

  /**
   * Overrides Drupal\Core\Routing\UrlGenerator::setContext();
   */
  public function setContext(RequestContext $context) {
  }

  /**
   * Implements Symfony\Component\Routing\RequestContextAwareInterface::getContext();
   */
  public function getContext() {
  }

  /**
   * Overrides Drupal\Core\Routing\UrlGenerator::processPath().
   */
  protected function processPath($path, &$options = array()) {
    return $path;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
NullGenerator::generate public function Overrides Drupal\Core\Routing\UrlGenerator::generate(); Overrides UrlGenerator::generate
NullGenerator::getContext public function Implements Symfony\Component\Routing\RequestContextAwareInterface::getContext(); Overrides UrlGenerator::getContext
NullGenerator::processPath protected function Overrides Drupal\Core\Routing\UrlGenerator::processPath(). Overrides UrlGenerator::processPath
NullGenerator::setContext public function Overrides Drupal\Core\Routing\UrlGenerator::setContext(); Overrides UrlGenerator::setContext
NullGenerator::__construct public function Override the parent constructor. Overrides UrlGenerator::__construct
ProviderBasedGenerator::$provider protected property The route provider for this generator.
ProviderBasedGenerator::getRouteDebugMessage public function Convert a route identifier (name, content object etc) into a string usable for logging and other debug/error messages Overrides VersatileGeneratorInterface::getRouteDebugMessage 1
ProviderBasedGenerator::supports public function Support a route object and any string as route name Overrides VersatileGeneratorInterface::supports 1
UrlGenerator::$basePath protected property The base path to use for urls.
UrlGenerator::$baseUrl protected property The base url to use for urls.
UrlGenerator::$context protected property
UrlGenerator::$decodedChars protected property This array defines the characters (besides alphanumeric ones) that will not be percent-encoded in the path segment of the generated URL.
UrlGenerator::$logger protected property
UrlGenerator::$mixedModeSessions protected property Whether both secure and insecure session cookies can be used simultaneously.
UrlGenerator::$pathProcessor protected property The path processor to convert the system path to one suitable for urls.
UrlGenerator::$request protected property A request object.
UrlGenerator::$routes protected property
UrlGenerator::$scriptPath protected property The script path to use for urls.
UrlGenerator::$strictRequirements protected property
UrlGenerator::doGenerate protected function 2
UrlGenerator::generateFromPath public function Implements \Drupal\Core\Routing\PathBasedGeneratorInterface::generateFromPath(). Overrides PathBasedGeneratorInterface::generateFromPath
UrlGenerator::getRelativePath public static function Returns the target path as relative reference from the base path.
UrlGenerator::httpBuildQuery public function Parses an array into a valid, rawurlencoded query string.
UrlGenerator::initialized protected function Returns whether or not the url generator has been initialized.
UrlGenerator::isStrictRequirements public function Returns whether to throw an exception on incorrect parameters. Null means the requirements check is deactivated completely. Overrides ConfigurableRequirementsInterface::isStrictRequirements
UrlGenerator::setBasePath public function Implements \Drupal\Core\Routing\PathBasedGeneratorInterface::setBasePath(). Overrides PathBasedGeneratorInterface::setBasePath
UrlGenerator::setBaseUrl public function Implements \Drupal\Core\Routing\PathBasedGeneratorInterface::setBaseUrl(). Overrides PathBasedGeneratorInterface::setBaseUrl
UrlGenerator::setRequest public function Implements \Drupal\Core\Routing\PathBasedGeneratorInterface::setRequest(). Overrides PathBasedGeneratorInterface::setRequest
UrlGenerator::setScriptPath public function Implements \Drupal\Core\Routing\PathBasedGeneratorInterface::setScriptPath(). Overrides PathBasedGeneratorInterface::setScriptPath
UrlGenerator::setStrictRequirements public function Enables or disables the exception on incorrect parameters. Passing null will deactivate the requirements check completely. Overrides ConfigurableRequirementsInterface::setStrictRequirements
UrlGeneratorInterface::ABSOLUTE_PATH constant Generates an absolute path, e.g. "/dir/file".
UrlGeneratorInterface::ABSOLUTE_URL constant Generates an absolute URL, e.g. "http://example.com/dir/file".
UrlGeneratorInterface::NETWORK_PATH constant Generates a network path, e.g. "//example.com/dir/file". Such reference reuses the current scheme but specifies the host.
UrlGeneratorInterface::RELATIVE_PATH constant Generates a relative path based on the current request path, e.g. "../parent-file".