Day Two with Code Igniter

So, after finishing the tutorial, I am now trying to create a login page, with restricted area behind the login page.

I am either doing it the wrong way or CI has a strange way to integrate login and session into its system.

I have an admin controller that handle the restricted pages. No matter what I tried, it just would not work. In the end I search Google and found a decent solution. The solution however requires me to create a login controller.

However, the tutorial was rather old, so some modifications need to be made to the sample code to make it work on the current Code Igniter (CI) code. Note that I am using CI 2.1.3. The sample code was using CI 2.0.2.

There is also a strange behaviour that I am not familiar. Despite using .htaccess, the form decides to use the old format of index.php/controller/function. This is confusing and start to make me frustated with the experience. The source of the problem is with the form action which defaults to the CI format of index.php/controller/function. Something that I am yet to find a workaround.

Overall, I find it to be rather frustating to work with. Perhaps because I am used to work with my own system that is as old as CI. I did start coding in PHP, since PHP 3.x. But the good thing is that if I am creating my own framework around 2002, it would be similar to this. And I am very sure it would be as confusing as this also, hahahahaha.

What I like about CI is that database and session are integrated into the system, so it is a simple invoke call to activate them. I am not satisfied with their View, however. Their controller system is also not familiar, but with time, I may like it.

It was a good experience though, to see how other framework works. Especially considering that I am building my own framewok. Who knows, I might fork Ci or make a competitor of CI.

PS. The website I am trying to create with this demo CI is a simple deals site, where the front end displays the deals, with simple backend to create the deals, hidden under admin, with login page, of course.


Simple Login with CodeIgniter In PHP