Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 199

Using a term introduced in Drupal 8, routes are the paths to which modules respond.

1
vote
An event subscriber is just a service tagged with name: event_subscriber and implemented by a class implementing the EventSubscriberInterface interface. The code you are using is supposed to use a se …
answered May 16 by kiamlaluno
2
votes
reference. It's probable you are getting confused between hook_menu() and hook_menu_alter(). The latter gets a $&items parameter, but the purpose of the hook is slightly different. (It's altering routes … defined from other modules, rather than defining new routes.) As side note, I would rather use the following code. function signin_menu() { $items = array(); $items['signin'] = array( 'title …
answered Oct 20 '18 by kiamlaluno
3
votes
' defaults: _controller: '\Drupal\hello_world\Controller\HelloWorldController::helloWorld' _title: 'Our first route' requirements: _permission: 'access content' See the example give in Routing API, Registering simple routes. …
answered Apr 11 '18 by kiamlaluno
3
votes
You cannot: The part of the path after the first slash cannot be dynamic, so you cannot use /{username} as path. This is explicitly stated in Structure of routes, which describes path as follows …
answered Apr 8 '18 by kiamlaluno
0
votes
Basing on the documentation for hook_menu() access arguments are inherited from the parent route only if the access callback is inherited, and that only happens for MENU_DEFAULT_LOCAL_TASK routes
answered Apr 7 '18 by kiamlaluno
0
votes
Change the access callback to user_is_anonymous(), and the page will be visible just to anonymous users. /** * Implements hook_menu(). */ function page_prog_menu() { $items['page_prog/custom'] = …
answered Mar 8 '18 by kiamlaluno
0
votes
The reason why the code doesn't work is that the same array index is being set twice. In that case, only the last value set is kept. That code is exactly equivalent to the following one. function mym …
answered Feb 18 '18 by kiamlaluno
0
votes
hook_menu() is not the hook to alter the routes defined from other modules, but in this case not even hook_menu_alter() would help. When users access a page using a path alias, Drupal gets the …
answered Nov 19 '17 by kiamlaluno
0
votes
parse_url($GLOBALS['base_url'], PHP_URL_HOST). That said, I would not use wmc.en/wmc/contact-us and gmc.es/gmc/contact-us as routes, since the domain name makes already the difference between a route and …
answered Oct 23 '17 by kiamlaluno
7
votes
Since I asked this question, Drupal 8 core changed, and some of the issues about routes have been fixed. hook_menu() is not used from Drupal 8 anymore; the routes a module uses are defined in a …
answered Mar 31 '17 by kiamlaluno
1
vote
No, hook_menu_alter() is not thought to dynamically add new routes. As any similar alter hook, it is thought to alter the routes defined from other modules. It would not work for dynamically adding … new routes for the simply fact that, similarly to hook_menu() is only invoked in specific cases, for example, when a module is installed, uninstalled, enabled, or disabled. If you need to have dynamic …
answered Nov 28 '16 by kiamlaluno
1
vote
The code you are using doesn't work simply because hook_menu() is not called all the times. Drupal caches the result of the implementations of hook_menu() and call them when the cache is invalidated, …
answered Aug 18 '16 by kiamlaluno
0
votes
The code is wrong because the access callback used (user_access()) accepts a user permission string as argument, not a role name. To check the role the currently logged in user has, you need your own …
answered Jul 3 '16 by kiamlaluno
2
votes
Since you are setting 'access callback' to TRUE, you are actually giving access to those routes to every user, including the anonymous users. You could easily set the access callback to a function in … your module 'access callback' => 'ibbr_inv_access_callback' and check the roles the global $user variable has, but that would be a bad idea, since every time you need to give access to those routes
answered Jul 3 '16 by kiamlaluno
2
votes
There are three functions calling menu_unserialize(), the function for which the error is reported: menu_get_item() uses it in the following code if ($router_item['access']) { $router_item['m …
answered Jun 21 '16 by kiamlaluno

15 30 50 per page