Recent ramblings... on CodeIgniter


Flexible themes and layouts in CodeIginter

I still love CodeIgniter, the simplicity and robust core keeps me coming back even if it has fallen out of favour with the web community recently (I'm not going to get into that right now) but there has always been a few libraries that I felt were missing, a decent Auth library for one, but also a nicer way of dealing with views, layouts and themes. I can of course understand the reasons for leaving them out as both are not an every day need but I alway seem get to a road block in my projects where I suddenly have a need for them, especially the layout library.


Testing for Cookies in CodeIgniter

Almost all the website made nowadays utilise cookies in some way, not always to track but just simply to pass data from page to page or to keep a login session active. With the recent misinformation about cookies in Europe more and more web users are blocking vitial cookies that are needed to run websites. This leads to confusion when the sites don’t work as expected and is especially irritating when trying to login to secure areas.

I recently made this little CodeIgniter helper which will test if a user has cookies enabled. This will work nicely in CodeIgniter and integrate with a callback on form validation. It works by first setting a test cookie and on form submit (Usually on the login form) will test that the test cookie exists in our form validation.