Difference between Codeigniter 1.7.3 and 2.0

Uncategorized 0 Comment 4
  • Support for PHP 4 is gone, PHP 5.1 is now a requirement.
  • CSRF Protection built into the form helper(CSRF – Cross-Site Request Forgery)
  • Added routing overrides to the main index.php file, enabling the normal routing to be overridden on a per “index” file basis.
  • Added $route[‘404_override’] to allow 404 pages to be handled by controllers.
  • Full query-string support
  • Automatic base_url  detection if left blank
  • New Cache driver with file system, APC and memcache support
  • Plug-ins has been removed, in favor of Helpers.

2.0.0 gets rid of the “Plugin” system as their functionality was identical to Helpers, but non-extensible. You will need to rename your plugin files from filename_pi.php to filename_helper.php, move them to your helpers folder, and change all instances of:

$this->load->plugin('foo'); to $this->load->helper('foo');

  • Update class extension

All the Classes are now prefixed with CI_.

  • Update construct classes

All the native codeigniter classes now use the php5 __construct()conversion

Controllers
class Contact extends Controller {
function Contact() {
parent::Controller();
}
}
Models
class Contact_model extends Model {
function Contact_model(){
parent::Model();
}
}

In Version 2.0.0
Controllers
class Contact extends CI_Controller {
function __construct()  {
parent::__construct();
}
}
Models
class Contact_model extends CI_Model {
function __construct()  {
parent::__contruct();
}
}
I highlighted the differences in red color.

Leave a comment

You must be logged in to post a comment.

© 2016 4frienz. Powered By Flowers

Back to Top