- πΊπΈUnited States smustgrave
Thank you for posting
As it's been 11 years wonder if this is still a desired feature?
Thanks!
It'd be awesome if you could do something like this in menu definitions:
$items['thing/new'] = array(
'title' => 'New thing',
'page callback' => 'my_thing_form',
'page arguments' => array(function() { return new MyThing; }),
);
$items['thing/%mything'] = array(
'title' => 'New thing',
'page callback' => 'my_thing_form',
'page arguments' => array(2),
);
And in turn the menu system could check to see if a given argument is callable and if so, call it when preparing the args. We already special case some things passed to arguments, i.e. integers correspond to parts of a path if load functions are defined.
But alas, closures can't be serialized :(
I know this is a pretty crazy request, but I think it would really make module coding alot cleaner by allowing closures in more places where we currently would have to rely on a separate procedural function for a simple 1 liner, and then in turn reference the name of that function in a string.
Any thoughts?
Postponed: needs info
9.5
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Thank you for posting
As it's been 11 years wonder if this is still a desired feature?
Thanks!