Skip to content

Feature Request: Give sections an option to route to a controller not just a template #2450

@tjdraper

Description

@tjdraper

With Craft 3 we can have a custom module for site specific features, controllers, services, twig extensions, you name it. And it's AAAAAMAZING. However, one thing that's bugging me is this: I've worked on (and am working on currently) sites where every page needs to run through custom controllers to make sure custom variables are set, custom logic is run etc. I've jumped through elaborate hoops to make this work in Craft 2. But in Craft 3, it seems to me there's an opportunity to allow routing to a custom Yii controller as an option and not just a template. If we could specify the controller and method a section should run for the entry's URL in the same way we can specify a Yii controller in a route (for instance dev/locations/entry in the case of a site I'm working on right now, that would be super duper fantastic.

So basically, as a feature request, anywhere we can tell Craft in the CMS to route a URI to a template, also give us the option to route to a controller action.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementimprovements to existing featuressystem administration 💼features related to system administration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions