We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Is it possible to define arbitrary routes that point to / trigger "ACT=XX" urls in EE?

Development and Programming

JCOGS Design's avatar
JCOGS Design
148 posts
4 years ago
JCOGS Design's avatar JCOGS Design

I have a custom add-on with a module that contains a class:method that generates a form.

I have registered the method as an Action (i.e. you can trigger it by going to domain.com/?ACT=XX).

So far so good… but I would like the form to be accessible via a more meaningful / useful URL (e.g. domain.com/myform).

Is there a way of coercing EE to run the method in response to an aribitrary set of segments rather than via the ACT= url that lives within EE (I realise I can do this via e.g. .htaccess etc.)?

Ideally I would like to set up something self-contained within the add-on to do this (so when you install add-on it adds whatever routing fix is required to the EE installation automatically).

Would value any thoughts / suggestions / insights!

Thanks!

       
Brian Litzinger's avatar
Brian Litzinger
704 posts
4 years ago
Brian Litzinger's avatar Brian Litzinger

Could make a template file and call a {exp:module:tag} and submit the form to that url/template. Or maybe look at something like Resource Router. https://github.com/rsanchez/resource_router

       
JCOGS Design's avatar
JCOGS Design
148 posts
4 years ago
JCOGS Design's avatar JCOGS Design

That’s helpful thanks. Having a tag on a page load the form occurred to me, but I was trying to find a solution that doesn’t involve either installing more add-ons on the EE host system, or adding a template/group the public site.

Do you think there is a way to call a CP page (and so use the CP/URL routing / mcp file) (or perhaps simulate this) even if the user is not logged into the site?

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.