Explore Yourself !!!


Power of CI 1.7 [More Powerful MVC]
October 29, 2008, 11:42 pm
Filed under: Code Igniter

Code igniter 1.7 version is really make programmer’s life more easier. Save a lot of time and made more tricky validation stuffs. moreover, control all validation of entire site from a single page.

The real power of this version is validation. How? By an example you have 30 forms in your e-commerce site and you add one field to feedback form. You not need to write a single line of code in your controller and model. Impossible? Not at all if you formerly write your model in a good manner. Which mean if you named all fields same(database table field name and html control name). So what you need is only add one field in your form_validation.php file and add additional field in your view file. that’s it.

Lets draw an example You want to add visitors contact number in contact us form. Add the following line in your form_validation.php

array(‘field’ => ‘contact_number’,'label’ => ‘contact number’,'rules’ => ‘required’),

and a text box in your view file which might locate at view/contact/contact_us.php

[input type="text" name="contact_number" value="<php echo set_value('fr', $default['fr']); >”]

that’s all. :) you have not opened your controller and model file. Real power of MVC :)


5 Comments so far
Leave a comment

Cool, perfect optimized code.

Comment by Rumana

a very useful post amin bhai …..

Comment by Nadia Ahmed

Useful!!! No man(wo). it’s powerful not useful :D

Comment by admin

Hmm. 100% vua posting

Comment by mamun

You are absolutely correct !!! Former two are wrong. ha ha ha But upni bujlen kevabe? Upni to pura …..

Comment by admin




Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>