Welcome Guest, Not a member yet? Register   Sign In
Library, Controller, Model, Helper, or Plugin?
#2

[eluser]libnac[/eluser]
I think you must use models.

you can use models in this way:

yourmodelmodel.php

class Yourmodel extends Model {
function Yourmodel() {..}

function view1() {

$select_sql = "table1.*, .... ";

return executeQry($select_sql);
}

function view2() {
...
}

...

function executeQry($select_sql) {

$this->obj->db->select($select_qry);
$query = $this->obj->db->get();
if($query->num_rows()>0 )
return $query->result();
}

}
}
or something like this...

And you can load this model in your controller constructor.

class Yourcontroller extends Controller {
function Yourcontroller() {
$this->load->model("yourmodelmodel")
}
}

I hope this will be useful for you


Messages In This Thread
Library, Controller, Model, Helper, or Plugin? - by El Forum - 06-22-2008, 07:27 AM
Library, Controller, Model, Helper, or Plugin? - by El Forum - 06-22-2008, 08:45 AM
Library, Controller, Model, Helper, or Plugin? - by El Forum - 06-22-2008, 09:00 AM
Library, Controller, Model, Helper, or Plugin? - by El Forum - 06-22-2008, 09:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB