Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
07a81f6d
Commit
07a81f6d
authored
Sep 22, 2012
by
Crell
Committed by
effulgentsia
Oct 01, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document hook_route_info().
parent
001c75b2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
core/modules/system/system.api.php
core/modules/system/system.api.php
+45
-0
No files found.
core/modules/system/system.api.php
View file @
07a81f6d
...
...
@@ -565,6 +565,51 @@ function hook_menu_get_item_alter(&$router_item, $path, $original_map) {
}
}
/**
* Defines routes in the new router system.
*
* A route is a Symfony Route object. See the Symfony documentation for more
* details on the available options. Of specific note:
* - _controller: This is the PHP callable that will handle a request matching
* the route.
* - _content: This is the PHP callable that will handle the body of a request
* matching this route. A default controller will provide the page
* rendering around it.
*
* Typically you will only specify one or the other of those properties.
*
* @deprecated
* This mechanism for registering routes is temporary. It will be replaced
* by a more robust mechanism in the near future. It is documented here
* only for completeness.
*/
function
hook_route_info
()
{
$collection
=
new
RouteCollection
();
$route
=
new
Route
(
'router_test/test1'
,
array
(
'_controller'
=>
'\Drupal\router_test\TestControllers::test1'
));
$collection
->
add
(
'router_test_1'
,
$route
);
$route
=
new
Route
(
'router_test/test2'
,
array
(
'_content'
=>
'\Drupal\router_test\TestControllers::test2'
));
$collection
->
add
(
'router_test_2'
,
$route
);
$route
=
new
Route
(
'router_test/test3/{value}'
,
array
(
'_content'
=>
'\Drupal\router_test\TestControllers::test3'
));
$collection
->
add
(
'router_test_3'
,
$route
);
$route
=
new
Route
(
'router_test/test4/{value}'
,
array
(
'_content'
=>
'\Drupal\router_test\TestControllers::test4'
,
'value'
=>
'narf'
,
));
$collection
->
add
(
'router_test_4'
,
$route
);
return
$collection
;
}
/**
* Define menu items and page callbacks.
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment