Why CodeIgniter is the best PHP Framework
Are you a PHP programmer?
I have been a PHP programmer for almost 10 years and I know it very well. When I was first turned onto the idea of model view controller frameworks, I did not immediately get the concept, but after a while, it started to click. Unfortunately, I started with Zend Framework!
Why Zend Framework turned me off.
When a previous boss asked me to learn MVC and Zend Framework, I was actually pretty excited about it, but Zend Framework required too much coding to do a simple thing like a database query or storing PHP sessions. I found it too time consuming to master and my hope was to use an MVC framework to do something simple quick, not a long process with too much coding. Unfortunately, that was all I knew about MVC programming.
I love this CodeIgniter book
CodeIgniter Makes It So Easy!
I was apprehensive about learning another MVC framework, because of how annoying I found Zend to learn, but I stuck to my guns with CodeIgniter and was not disappointed.
With Zend Framework, you simply load a class library, helper, or driver and use its functionality in a nice object oriented format. It is simple and very little coding. Plus it is secure.
CodeIgniter has class libraries that are easy to load
CodeIgniter has libraries for popular PHP concepts that are sometimes time consuming to program in PHP like the following:
- Unit Testing
- Form Validation
- Shopping Carts
- Session handling
- File uploading
- Zip file handling
These functions require a lot of coding in normal PHP, but CodeIgniter helps get the job done with very little code saving us programmers time.
A sample of how to loading and using libraries in CodeIgniter works
// Simply load the name of the library like this: $this->load->library('class name'); // So for example, to create a pagination $this->load->library('pagination'); // Define the pagination configuration $config['base_url'] = 'http://example.com/index.php/test/page/'; $config['total_rows'] = 200; $config['per_page'] = 20; $this->pagination->initialize($config); echo $this->pagination->create_links(); // CodeIgniter creates the links for you. All you need to do is create the base_url and it does the work for you!
CodeIgniter implements popular security features
CodeIgniter includes build in security for SQL Injections and XSS filtering as well as CSRF (Cross site request forgery)
The security class contains methods for sanitizing your data with $this->security->xss_clean().
Cross site request forgery can be accomplished with a simple switch in your CodeIgniter config file by setting it to TRUE as $config['csrf_protection'] = TRUE;
In conclusion, I encourage all serious PHP programmers to try CodeIgniter
if you are turned off by Zend Framework like I am, do not dispair about MVC. Learn CodeIgniter. it is quick to learn and program and has helper functions to help with most code intensive PHP functionality.
The manual is one of the easiest to learn among all of the PHP MVC frameworks.