Timeline for why does hook_menu produce a menu that belongs to the system module?
Current License: CC BY-SA 3.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 9, 2012 at 23:03 | comment | added | avpaderno♦ | Drupal 8 will use Symfony. The routing part is already being rewritten to use it. | |
Dec 9, 2012 at 22:44 | comment | added | Joe Corneli |
Also, another problem with menu_link_save() is that it doesn't straightforwardly allow me to add a page callback . There's considerable discussion about how this will all be rewritten in D8 anyway, so I'm not going to worry about it too much...
|
|
Dec 9, 2012 at 22:32 | comment | added | avpaderno♦ |
You can also use menu_link_save() , but the module should also remove the link once it is disabled. I prefer using MENU_SUGGESTED_ITEM because the link is automatically removed when the module is disabled; when the module is re-enabled, the link is automatically added where it was before.
|
|
Dec 9, 2012 at 22:30 | vote | accept | Joe Corneli | ||
Dec 9, 2012 at 22:28 | comment | added | Joe Corneli |
Or maybe use menu_link_save? Frankly the design decision that says we should "distinguish" hook_menu links from other kinds of links seems weird to me. But any, I think I understand now (sorta). Thanks!
|
|
Dec 9, 2012 at 22:24 | comment | added | avpaderno♦ |
You can use hook_menu() , but use MENU_SUGGESTED_ITEM as type. In that way, the link will appear in a menu if an administrator user enables it.
|
|
Dec 9, 2012 at 22:20 | comment | added | Joe Corneli |
What is the alternative to hook_menu() for adding links directly from a module?
|
|
Dec 9, 2012 at 10:52 | history | edited | avpaderno♦ | CC BY-SA 3.0 |
deleted 1 characters in body
|
Dec 9, 2012 at 10:28 | history | answered | avpaderno♦ | CC BY-SA 3.0 |