Update to Drupal 8.0-dev-2015-11-17. Commits through da81cd220, Tue Nov 17 15:53:49 2015 +0000, Issue #2617224 by Wim Leers: Move around/fix some documentation.
This commit is contained in:
parent
4afb23bbd3
commit
7784f4c23d
929 changed files with 19798 additions and 5304 deletions
33
core/lib/Drupal/Core/Routing/Enhancer/FormRouteEnhancer.php
Normal file
33
core/lib/Drupal/Core/Routing/Enhancer/FormRouteEnhancer.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Core\Routing\Enhancer\FormRouteEnhancer.
|
||||
*/
|
||||
|
||||
namespace Drupal\Core\Routing\Enhancer;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Route;
|
||||
|
||||
/**
|
||||
* Enhancer to add a wrapping controller for _form routes.
|
||||
*/
|
||||
class FormRouteEnhancer implements RouteEnhancerInterface {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function applies(Route $route) {
|
||||
return $route->hasDefault('_form') && !$route->hasDefault('_controller');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function enhance(array $defaults, Request $request) {
|
||||
$defaults['_controller'] = 'controller.form:getContentResult';
|
||||
return $defaults;
|
||||
}
|
||||
|
||||
}
|
|
@ -44,8 +44,12 @@ class ParamConversionEnhancer implements RouteEnhancerInterface, EventSubscriber
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function enhance(array $defaults, Request $request) {
|
||||
$defaults['_raw_variables'] = $this->copyRawVariables($defaults);
|
||||
return $this->paramConverterManager->convert($defaults);
|
||||
// Just run the parameter conversion once per request.
|
||||
if (!isset($defaults['_raw_variables'])) {
|
||||
$defaults['_raw_variables'] = $this->copyRawVariables($defaults);
|
||||
$defaults = $this->paramConverterManager->convert($defaults);
|
||||
}
|
||||
return $defaults;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -246,7 +246,7 @@ class RouteProvider implements PreloadableRouteProviderInterface, PagedRouteProv
|
|||
* @return array
|
||||
* An array of outlines that could match the specified path parts.
|
||||
*/
|
||||
public function getCandidateOutlines(array $parts) {
|
||||
protected function getCandidateOutlines(array $parts) {
|
||||
$number_parts = count($parts);
|
||||
$ancestors = array();
|
||||
$length = $number_parts - 1;
|
||||
|
@ -355,7 +355,7 @@ class RouteProvider implements PreloadableRouteProviderInterface, PagedRouteProv
|
|||
/**
|
||||
* Comparison function for usort on routes.
|
||||
*/
|
||||
public function routeProviderRouteCompare(array $a, array $b) {
|
||||
protected function routeProviderRouteCompare(array $a, array $b) {
|
||||
if ($a['fit'] == $b['fit']) {
|
||||
return strcmp($a['name'], $b['name']);
|
||||
}
|
||||
|
|
|
@ -309,6 +309,9 @@ class UrlGenerator implements UrlGeneratorInterface {
|
|||
$name = $this->getRouteDebugMessage($name);
|
||||
$this->processRoute($name, $route, $parameters, $generated_url);
|
||||
$path = $this->getInternalPathFromRoute($name, $route, $parameters, $query_params);
|
||||
// Outbound path processors might need the route object for the path, e.g.
|
||||
// to get the path pattern.
|
||||
$options['route'] = $route;
|
||||
$path = $this->processPath($path, $options, $generated_url);
|
||||
|
||||
if (!empty($options['prefix'])) {
|
||||
|
|
|
@ -77,6 +77,10 @@ interface UrlGeneratorInterface extends VersatileGeneratorInterface {
|
|||
* @throws \Symfony\Component\Routing\Exception\InvalidParameterException
|
||||
* Thrown when a parameter value for a placeholder is not correct because it
|
||||
* does not match the requirement.
|
||||
*
|
||||
* @internal
|
||||
* Should not be used in user code.
|
||||
* Use \Drupal\Core\Url instead.
|
||||
*/
|
||||
public function generateFromRoute($name, $parameters = array(), $options = array(), $collect_bubbleable_metadata = FALSE);
|
||||
|
||||
|
|
Reference in a new issue