Skip to content

Instantly share code, notes, and snippets.

@develCuy
Created April 24, 2014 17:48
Show Gist options
  • Save develCuy/11263308 to your computer and use it in GitHub Desktop.
Save develCuy/11263308 to your computer and use it in GitHub Desktop.
Ophal version of route(menu) callbacks(ala D6/D7):
--[[
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