Background- Using Code Igniter version 3.0-dev, I'm building a simple CMS. All frontend page URLs can be modified by the user in the /admin section of the site. The pages can also have different templates or page types, which will different data loaded/processed. e.g.
- a page like /about/who-we-are/ would just load rich text editor content and not much else;
- whereas a page like /locations/stores/ would load rich text content, a list of locations that would need processing, map data etc.
The user can create a page, select the page type, then add content for it, so there is no way to know ahead of time which URLs point where.
Current situation- Currently all traffic goes to PublicController index action, which finds the page and page type. I think, going by how I understand MVC to work, each page type should be a separate inherited controller, but maybe they should just be actions of the public controller? Anyway that finally brings me to the question...
Question- How can I call the correct controller manually?
The only way I've found is via redirect(), which wouldnt work for me as I need the URL to not change, and I don't want to trigger a needless additional request for every page load.
Aucun commentaire:
Enregistrer un commentaire