![]() |
SIMPLE Backend / Frontend : configuration. A.K.A "poor man's modules" - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: SIMPLE Backend / Frontend : configuration. A.K.A "poor man's modules" (/showthread.php?tid=38969) |
SIMPLE Backend / Frontend : configuration. A.K.A "poor man's modules" - El Forum - 02-24-2011 [eluser]rawoke083[/eluser] Hi Guys I thought i present this solution might not be the best but works great for me. We all know CodeIgniter don't have modules "out of the box" not that it's a bad thing but I usually need it. ATLEAST a admin/backed module: Case Study: 1) So we have http://www.mysite.com: Frontend site build on CI. 2) We have a http://admin.mysite.com Backend site build on CI (same codebase / instal as frontend) 3) Directory struct: >application\ -->controllers\ ---->product.php (frontend controller) -->views\ ----->product\ ------->list.php (frontend list view of product) -->modules\ (NB ! NB !) ---->admin\ ------>controllers\ -------->product.php (admin controller) ---->views\ ------->product\ --------->list.php (admin list view of product) 4) Code changes in index.php Quote: // round about line 120 towards the end -------------------------- Code changes CodeIgniter.php +- LINE 222 Quote://add CONTROLLER_PATH_PREFIX --------------------------- Code Changes in Loader.php in constructor Quote:function __construct() ----------------------------------- So ja 3 files to edit may be 10 lines and you can have frontend/backend support I'm sure there are ways to improve on this. Comments welcome |