Welcome Guest, Not a member yet? Register   Sign In
ci-3 how to create admin without duplicating core files
#8

(06-27-2016, 05:39 AM)siva Wrote: thanks for the reply [ @InsiteFX @Ivo Miranda @skunkbad Wrote] ... i mean if i enter www.example.com/admin,  it should go to admin login page,so how will be the directory structure? which means separate front-end and back-end.

ex:
if its user side :
/application

admin:
/application/admin [here all the admin files].

Is this your first CI app? You have several options but I will give you an easy example:
1) /application/controllers/Admin.php would be your controller and you will be able to access it by default by example.com/admin
2) In this Admin.php controller you should have all the methods, like login, register, and so on... You might want to keep some core functionality in a library rather then putting all of it in the controller but that is up to you.
3) If you want to use a controller for the frontend you can just you a default controller in the config and access it in example.com. That controller should contain all logic for the user that is not an admin.

Is this what you were looking for? I strongly recommend you to do the Code Igniter tutorial and read all the documentation. It's possibly one of the easiest documentation I have ever read in my life and the tutorial is also pretty useful.

Please take into consideration that building an authentication system is something really hard to do. I would recommend to use a third party library such as Ion Auth.
Reply


Messages In This Thread
RE: ci-3 how to create admin without duplicating core files - by Ivo Miranda - 06-27-2016, 07:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB