J_Szwarga Posted February 28, 2020 Share Posted February 28, 2020 I created a process module. From a hook in ready.php, I need to access the full http url for this process module's "page". <?php namespace ProcessWire; $info = [ 'title' => 'Sermon Requests', 'summary' => 'Dashboard for approving users to listen to the sermons archive', 'author' => 'Joel Szwarga', 'version' => 1, 'page' => [ 'name' => 'rolerequests', 'title' => 'Sermon Requests', ], ]; So I need to get the url for: http:mysite.com/admin/setup/rolerequests/ I need to retrieve this url while just having the name of the module class (In this case, UserRoleRequests) Because the page's name/url can change, I can't hardcode that part here. I've tried every form of wire()->urls() and modules()->get("UserRoleRequests")->propertyname. Thought this would be really simple but don't see it anywhere. Is there a $pages->get() selector that can let me use the process module classname as a way to find the admin page? Link to comment Share on other sites More sharing options...
dragan Posted February 28, 2020 Share Posted February 28, 2020 13 minutes ago, J_Szwarga said: Because the page's name/url can change Why is that? Surely, if you change the name in the module, next time you refresh modules, the name of the page in admin/setup/ will also change? Link to comment Share on other sites More sharing options...
BitPoet Posted February 28, 2020 Share Posted February 28, 2020 5 minutes ago, J_Szwarga said: Is there a $pages->get() selector that can let me use the process module classname as a way to find the admin page? You can get the page directly by calling $module->getProcessPage() 2 Link to comment Share on other sites More sharing options...
J_Szwarga Posted February 28, 2020 Author Share Posted February 28, 2020 15 minutes ago, BitPoet said: You can get the page directly by calling $module->getProcessPage() YES!! Thank you! 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