Drupal 8  8.0.2
PathProcessorLanguage Class Reference
Inheritance diagram for PathProcessorLanguage:

Public Member Functions

 __construct (ConfigFactoryInterface $config, ConfigurableLanguageManagerInterface $language_manager, LanguageNegotiatorInterface $negotiator, AccountInterface $current_user, ConfigSubscriber $config_subscriber)
 
 processInbound ($path, Request $request)
 
 processOutbound ($path, &$options=array(), Request $request=NULL, BubbleableMetadata $bubbleable_metadata=NULL)
 
 initConfigSubscriber ()
 
 reset ()
 

Protected Member Functions

 initProcessors ($scope)
 

Protected Attributes

 $config
 
 $languageManager
 
 $negotiator
 
 $processors
 
 $multilingual
 
 $configSubscriber
 

Detailed Description

Processes the inbound path using path alias lookups.

Constructor & Destructor Documentation

__construct ( ConfigFactoryInterface  $config,
ConfigurableLanguageManagerInterface  $language_manager,
LanguageNegotiatorInterface  $negotiator,
AccountInterface  $current_user,
ConfigSubscriber  $config_subscriber 
)

Constructs a PathProcessorLanguage object.

Parameters
\Drupal\Core\Config\ConfigFactoryInterface$configA config factory object for retrieving configuration settings.
\Drupal\language\ConfigurableLanguageManagerInterface$language_managerThe configurable language manager.
\Drupal\language\LanguageNegotiatorInterfaceThe language negotiator.
\Drupal\Core\Session\AccountInterface$current_userThe current active user.
\Drupal\language\EventSubscriber\ConfigSubscriber$config_subscriberThe language configuration event subscriber.

References Drupal\config(), Drupal\languageManager(), and LanguageNegotiatorInterface\setCurrentUser().

Here is the call graph for this function:

Member Function Documentation

initConfigSubscriber ( )

Initializes the injected event subscriber with the language path processor.

The language path processor service is registered only on multilingual site configuration, thus we inject it in the event subscriber only when it is initialized.

initProcessors (   $scope)
protected

Initializes the local cache for language path processors.

Parameters
string$scopeThe scope of the processors: "inbound" or "outbound".

References Drupal\languageManager(), and Unicode\ucfirst().

Referenced by PathProcessorLanguage\processInbound(), and PathProcessorLanguage\processOutbound().

Here is the call graph for this function:

Here is the caller graph for this function:

processInbound (   $path,
Request  $request 
)

{Processes the inbound path.

Parameters
string$pathThe path to process, with a leading slash.
\Symfony\Component\HttpFoundation\Request$requestThe HttpRequest object representing the current request.
Returns
string The processed path.
}

Implements InboundPathProcessorInterface.

References PathProcessorLanguage\initProcessors().

Here is the call graph for this function:

processOutbound (   $path,
$options = array(),
Request  $request = NULL,
BubbleableMetadata  $bubbleable_metadata = NULL 
)

{Processes the outbound path.

Parameters
string$pathThe path to process, with a leading slash.
array$options(optional) An associative array of additional options, with the following elements:
  • 'query': An array of query key/value-pairs (without any URL-encoding) to append to the URL.
  • 'fragment': A fragment identifier (named anchor) to append to the URL. Do not include the leading '#' character.
  • 'absolute': Defaults to FALSE. Whether to force the output to be an absolute link (beginning with http:). Useful for links that will be displayed outside the site, such as in an RSS feed.
  • 'language': An optional language object used to look up the alias for the URL. If $options['language'] is omitted, it defaults to the current language for the language type LanguageInterface::TYPE_URL.
  • 'https': Whether this URL should point to a secure location. If not defined, the current scheme is used, so the user stays on HTTP or HTTPS respectively. TRUE enforces HTTPS and FALSE enforces HTTP.
  • 'base_url': Only used internally by a path processor, for example, to modify the base URL when a language dependent URL requires so.
  • 'prefix': Only used internally, to modify the path when a language dependent URL requires so.
  • 'route': The route object for the given path. It will be set by ::generateFromRoute().
\Symfony\Component\HttpFoundation\Request$requestThe HttpRequest object representing the current request.
\Drupal\Core\Render\BubbleableMetadata$bubbleable_metadata(optional) Object to collect path processors' bubbleable metadata.
Returns
string The processed path.
}

Implements OutboundPathProcessorInterface.

References PathProcessorLanguage\initProcessors(), and Drupal\languageManager().

Here is the call graph for this function:

reset ( )

Resets the collected processors instances.


The documentation for this class was generated from the following file: