Dec
28
2011
28
2011
Codeigniter Tips and Tricks
Hi friends,
Codeigniter is my all time favorite php framework in my life. So here I want to share few codeigniter tips and tricks to you.
feel free to ask any doubts about this tips.
CodeIgniter is very easy me to install. It requires PHP version 4.3.2 or newer and one of the following databases: MySQL, MySQLi, MS SQL, ODBC, Oracle, Postgre or SQLite. Most people (myself included) use MySQL, but it’s good to know it supports some of the other big names.
Best of all, CodeIgniter is available as freeware so there is no charge for downloading and using this software! Even though EllisLab Network offers the CodeIgniter software free of charge, they still provide user forums, a wiki and a bug tracker to help support the application and its community of users.
If you are looking for the best way to streamline your PHP web development process, then CodeIgniter may be just the application that you need – I know it was for me.
I have more than 3 years exp in codeigniter.
- Always try to follow the MVC Structure as this is the basic for all frameworks and ofcourse with CI. Always write your Logic in Controllers , HTML in Views and Databases queries in Model.
- Whenever you start with CI project , always start with defining your project’s site configuration as this helps you to be more clear about your site configuration, with CI you can start with config.php file in your application/config folder as this is what you define your site’s base url which will be used while coding throughout the project and also you can set other options like language, charsets etc.
- Always define your common libraries , models, helpers that will be required throuphout your site in application/config/autoload.php file as this helps you to avoid the overhead for including all common libraries , models, helpers everytime you write a new controller
- Always use your controller’s and model’s class name same as your filename as because this is rule for CI and also it makes it easy to go through your controller or models.
- Always use CI’s own set of libraries and helpers as they are more secure and can save our time to code our own security code though they are available with us.
- For form validations always use CI’s form validation libraries as it has in built XSS and MySql injection vulnerability prevention ability.
- Never keep Scaffolding enable on live site.
- Always escape your user input that you are passing to your database , this helps you to prevent unwanted attacks on your database. CI has it’s own escapea function.
- Always follow the CI style commenting as it is more descriptive and clear.
- Always keep your admin files and frontend files in different folder’s as it easy to differiantiate and work. This is only applicable for views and models.
- Use Activation Records functions for immediate and small database requests like count number of rows , select records etc as this saves our time to write long queries unnecassarily.
- To boost your site performance always use Query caching available in CI , your database usage can effectively be reduced to zero for any pages that have been cached.
- Always read the PHP style guide in CI user’s guide before if you are new to CI, you can find this in CI user’s guide
- And last but not least never use Short tags <?=?> as this may be not allowed in higher versions of PHP ( 6.x)
Drop your comments
Tags: codeigniter, tips & tricks
Related Posts
1 Comment + Add Comment
Leave a comment
Popular Posts
- Notification Message boxes with CSS & Jquery (1,825)
- Free Pricing Tables Using Jquery & CSS (1,771)
- Twitter like login form, search box, top panel using Jquery and CSS (1,377)
- Attractive Free Pricing Tables Using CSS3 (1,355)
- Facebook like fetch url data using PHP Curl, Jquery and Ajax (1,329)
- Cool Notification / Alert Message Boxes using CSS (1,042)
- Fixed Top Navbar/Panel While Scrolling in CSS and Jquery (784)
- Free Sliding Fixed Login Form Top Panel Using Jquery & CSS3 (777)
- Digg like top panel / top bar, search box, drop down menu using CSS and Jquery (757)
- Free CSS3 Small, large, Download Buttons (718)
Today's Popular
- Free Pricing Tables Using Jquery & CSS (13)
- Attractive Free Pricing Tables Using CSS3 (11)
- Twitter like login form, search box, top panel using Jquery and CSS (7)
- Notification Message boxes with CSS & Jquery (6)
- Digg like top panel / top bar, search box, drop down menu using CSS and Jquery (5)
- Cool Notification / Alert Message Boxes using CSS (4)
- Free Elegant Table Designs Using CSS (4)
- Top 5 Free PHP & Mysql Cheat Sheets (3)
- FeedParser Jquery Plugin – Parse Rss feed, Atom feed, XML (3)
- Free Jquery Model Boxes using CSS (3)
Categories
- Codeigniter (5)
- CSS3 (19)
- facebook (6)
- Freebies (30)
- htacess (3)
- html5 (5)
- jquery (31)
- PHP (28)
- twitter (3)
- Uncategorized (1)
- Web Design (30)
- wordpress (7)
Tags
API
Button
Cascading Style Sheets
chat
codeigniter
counter
CSS3
date
Design
facebook
facebook application
favicon
fbml
freebies
Gallery
google+
Graph API
htaccess
HTML5
icons
image gallery
index.php
javascript
Jquery
jquery plugin
jquery tips
Like button
Login form
new techniques
payment icons
php
Plug-ins
plugins
pricing table
rss feed
scroll div
shoutbox
Signup form
slider
tips & tricks
top bar
twitter
Website
website speed
wordpress
Recent Comments
- Francisco Quintero on Fetch / embed videos from url using PHP and Jquery
- Sushin on Facebook like fetch url data using PHP Curl, Jquery and Ajax
- Karthikeyan on Facebook like fetch url data using PHP Curl, Jquery and Ajax
- udhay on Facebook like fetch url data using PHP Curl, Jquery and Ajax
- Free Google Plus Icon Set Download on Google+ UI Icons, buttons, labels, dropmenu using Jquery and CSS3
- kurnia1 on Attractive Free Pricing Tables Using CSS3
- felipe on Notification Message boxes with CSS & Jquery
- Free Stylish CSS3 Buttons with Icons | Php, mysql, ajax, jquery, javascript, css, html - Blog, Tutorials, Tips, Demos on Free CSS3 Small, large, Download Buttons
- Karthikeyan on How to make your own google instant search using Jquery and Google CSE
- Sean on How to make your own google instant search using Jquery and Google CSE

Posted by

[...] More here: Codeigniter Tips and Tricks | Php, mysql, ajax, jquery, javascript, css … [...]