Created
April 24, 2014 17:48
-
-
Save DevElCuy/11263308 to your computer and use it in GitHub Desktop.
Ophal version of route(menu) callbacks(ala D6/D7):
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Implements hook route(). | |
]] | |
function route() | |
items = {} | |
-- Local callback, no arguments | |
items['frontpage'] = { | |
page_callback = 'front_page', | |
} | |
-- External page callback function (it belongs to another module) | |
items['content/stats'] = { | |
page_callback = {module = 'content', 'stats'}, | |
} | |
-- Local access callback, with arguments | |
items['user/account'] = { | |
page_callback = 'account_page', | |
access_callback = {'access', 'administer migrations'}, | |
} | |
return items | |
end | |
-- You tell me how elegant/awkward is this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment