Welcome Guest, Not a member yet? Register   Sign In
Models and Libraries
#2

[eluser]Sbioko[/eluser]
Models are needed for interaction with database. Models allow you to not work with database in controllers. For example:
Code:
<?php
class SomeController extends Controller {
//...
    public function test() {
        $this->load->model('Posts');
        $posts = $this->posts->get_posts();
        $this->load->view('posts', $posts);
    }

}
I hope you understood it :-) If not, write me.


Messages In This Thread
Models and Libraries - by El Forum - 03-18-2010, 01:07 PM
Models and Libraries - by El Forum - 03-18-2010, 02:06 PM
Models and Libraries - by El Forum - 03-18-2010, 02:10 PM
Models and Libraries - by El Forum - 03-18-2010, 02:14 PM
Models and Libraries - by El Forum - 03-18-2010, 02:38 PM
Models and Libraries - by El Forum - 03-18-2010, 02:58 PM
Models and Libraries - by El Forum - 03-18-2010, 04:15 PM
Models and Libraries - by El Forum - 03-18-2010, 05:14 PM
Models and Libraries - by El Forum - 03-18-2010, 10:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB