Codeigniter: Helpers, Plugins and Libraries | Ask About PHP

Plugins – I put all 3rd party codes I’m using in my application as Plugins. I would, as best as I can, try to use classes rather than straight function calls.

Helpers – Any standalone straight functions calls, which are repetitive in nature, I classify them as Helpers. For example, sorting functions, my own calculation functions, etc

Libraries – I classify my own classes as ‘Libraries’. Normally, if I’m already writing a class in my application, it would then to be the core logic of the application, as such, I group them all in the Library folder.

via Codeigniter: Helpers, Plugins and Libraries | Ask About PHP.

Integrating CI with SocialEngine: Matching the database tables

SE4 uses the table prefix as engine4_ , So what you can do to make the SE4 codes same for CI Tables?
You can add table prefix in CI. For example i used ‘engine4_webadmin’. Now SE4 can get the database table by prefix ‘engine4_’, where the CI will catch the tables with prefix ‘engine4_webadmin’.
You will not need to change the codes of either CI or SE4.
If you have another good option please let me know.

CI handles file upload

I hope you know the following line,
yap, these line uploads a file in CI.
Now whats happen when multiple uploaded files have same name?
a counting number is added after the file name in such case.
If you upload a file ‘image.jpg’, then upload another file with the same name, CI will change the file name as ‘image1.jpg’

Changing the base path in CodeIgniter

To change the base path of codeigniter, go to config.php in application/config folder,
modify the following line,
$config[‘base_url’] = ‘’;
That will work with echo base_url();

Database prefix in CodeIgniter

You can set database table prefix in codeigniter. To do this,open the database.php file in config folder or application and modify these,
$db[‘default’][‘dbprefix’] = ‘web_admin’; // change to any name
Now when you write these,
$query = $this->db->get_where(‘_admin’, array(‘admin_name’ => $user_name,’password’ => do_hash($user_pass, ‘md5’)));
It will try to find web_admin_admin table of your database.

CodeIgniter is Great

Codeigniter is great to understand and learn. If you consider CI,Cake PHP or symfony, you will see that CI is easy. I learned it when i was a student of university.
Now the point is Although CI is easy to learn, But i Think symfony has a lot of option to do. Symfony has the support of twig and doctrine. Which makes it a true framework.
Now lets point on the size. Codeigniter is small, really small, and have Active Record support. But CI don’t have YAML support i think.
Symfony 2 has the support of YAML but it is not as light as CI.

I still prefer CI , Cause support is the best option to determine a framework.