Admin App |
Hi there . I'm new to ci enviroment and i have some questions to some more experienced users .
Is there any chance to have separate admin app folder and logic like wordpress does ? Separate routes frontend from backend ? loading routes per first uri segment? Right now i've installed ci4 and moved index.php and htacces file back into root folder , added admin foder(custom script not related to ci4) i can acces backend and everything works fine there (not loading any ci4 classes ). yoursite .com /codeiniter/admin/index.php?page=settings&do=permalinks front end works fine .. but doesn't seems to be the right way to do it . working on xampp localhost so /codeigniter folder it's a must, no virtual host added. Thanks ! Code: <IfModule mod_rewrite.c>
Mapping your website to your project route is not a secure practice!
XAMPP supports virtual hosting, so there should be no problem there. You could always use a subdomain, eg www.yoursite.com and admin.yoursite.com, if you want to keep them separate. They could still share a CodeIgniter folder. There is nothing wrong with having an admin folder inside app/, with nested Controllers folders etc. You could setup routes to suit the URIs you want to see. Not sure if that is what Wordpress does or not. This is closest to what has been called "HMVC" in CodeIgniter 3. There is also nothing wrong with having an admin folder inside app/Controllers, with some form of role-based access so that functionality is only usable by someone in an "admin" role.
Hi
If your going to make the admin backend in codeigniter then thats what the modules folder is for if I'm not mistaken, use the app folder for the frontend for normal users, then create a /modules/admin, and duplicate the folder structure from the main app inside it (it has to have PSR4 namespaces), setup your app/config/autoload.php file. It's in the manual. Failing that, use virtual hosting as has been suggested. If your using Windows I,ll walk you through it, it's fairly easy. Hope that helps.
Hy. Thanks for your replay . I don't wanna load 60-70 admin routes for every front request . I already have user defined routes in database for every front request redirecting to app routes . Ill try yii framework aproach redirecting from htacces to admin or front from root or get first segment in public index and load addmin or app based on first segment
Route Groups
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |