nikola Posted December 4, 2011 Share Posted December 4, 2011 How can I pass arguments from template to a function that resides in the module? I'm making a new module and can't figure it out... Normally if I use a function directly in template(s), I can do the following: echo function($1, $2, $, $4); where $1, $2, $3, $4 are arguments passed to a function. Link to comment Share on other sites More sharing options...
Soma Posted December 4, 2011 Share Posted December 4, 2011 In the module's hook function you can do something like this: <?php public function someCustomFunction( HookEvent $event ) { // get page object $page = $event->object; // get first argument $some_id = (int) $event->arguments[0]; // current language $lang = $event->arguments[1]; Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now