Get arguments of single page in package controller
Permalink
Hi,
I want to get the arguments of a single page within a package controller.
The page is /dashboard/users/search/view/3/. In this case the (single)page controller is /dashboard/users/search/ where the method is view and the argument is 3.
In my package controller I want to get the 3.
Any ideas?
Best,
Corretje
I want to get the arguments of a single page within a package controller.
The page is /dashboard/users/search/view/3/. In this case the (single)page controller is /dashboard/users/search/ where the method is view and the argument is 3.
In my package controller I want to get the 3.
Any ideas?
Best,
Corretje
Hi John,
Thanks for answering. I know howit works in a single page controller. But I need to do this in an event within a new package controller.
Best,
Corretje
Thanks for answering. I know howit works in a single page controller. But I need to do this in an event within a new package controller.
namespace Concrete\Package\MyNewPackage use ... class Controller extends Package { function on_start() { // get params / arguments for page /dashboard/users/search/view/3 ... } }
Best,
Corretje
That is an on_start method.
Within that you need to register an on_start event handler.
Once inside the on_start event handler you can get the current page and request objects.
Within that you need to register an on_start event handler.
Once inside the on_start event handler you can get the current page and request objects.
Of course! Sorry!
I got it working. Thank you.
I got it working. Thank you.
(and the rest happens by magic)
For block controllers its a bit more complicated. Best example to crib is in the core page list block controller.