Serve a static page using a single controller w/o making its own controller |
09-04-2016, 08:30 PM
(This post was last modified: 09-04-2016, 09:27 PM by 678238515702801. Edit Reason: Modified htaccess; added routes.php )
I have the following folder structure wherein inside the "views" folder I have several static pages organized by their "parent":
Code: my_project/ I have the following controller to serve all the views that are direct children of "pages". Code: <?php I have no problems linking to the top-level views under "pages" but when I traverse to a subfolder, it returns a 404. htaccess for reference: Code: <IfModule mod_rewrite.c> route.php PHP Code: $controller_views = 'pages/view'; What I want to achieve: From the folder structure above, I want to show "organization.php" and "history.php" through Pages::view() and calling them in my header as: Code: <a href='<?php echo base_url().'about/organization'; ?>'>Company Organzation</a> Current workaround: I made specific classes similar to Pages::view() for each of these subfolder views such as About::organization() and About::history(). I have no idea if I can serve subfolder static pages without resorting to the strict "controller/method" pattern but I hope you can help me with this. Currently there are no specific questions like mine online so I am looking forward to your advise. |
Messages In This Thread |
Serve a static page using a single controller w/o making its own controller - by 678238515702801 - 09-04-2016, 08:30 PM
RE: Serve a static page using a single controller w/o making its own controller - by InsiteFX - 09-05-2016, 04:28 AM
RE: Serve a static page using a single controller w/o making its own controller - by 678238515702801 - 09-05-2016, 05:18 PM
RE: Serve a static page using a single controller w/o making its own controller - by InsiteFX - 09-06-2016, 03:54 AM
RE: Serve a static page using a single controller w/o making its own controller - by 678238515702801 - 09-06-2016, 04:04 AM
RE: Serve a static page using a single controller w/o making its own controller - by InsiteFX - 09-06-2016, 09:12 AM
|