Welcome Guest, Not a member yet? Register   Sign In
Extending Model class
#3

[eluser]marcalj[/eluser]
...well I will explain in more detail the problem.

I have a library (CI model replacement):
Code:
class CMS_Model extends Model
{
    var $sTableName;
    
    function CMS_Model()
    {
        // Call the Model constructor
        parent::Model();
    }
    
    function getNumRows()
    {
        return $this->db->count_all( $this->sTableName );
    }
...
}
located in " APPPATH . /libraries "

So all my model classes extends from CMS_Model:
Code:
class Projecte_model extends CMS_Model
{
    function Projecte_model()
    {
        // Call the Model constructor
        parent::CMS_Model();
        
        $this->sTableName = "projecte";
    }
...
}
This is how I make the controllers "generation".

The problem is that I have to include the file of CMS_Model definition and I don't why.

Now I suppose is better explanation Smile

Thanks.


Messages In This Thread
Extending Model class - by El Forum - 07-09-2007, 06:18 AM
Extending Model class - by El Forum - 07-09-2007, 06:49 AM
Extending Model class - by El Forum - 07-10-2007, 01:54 AM
Extending Model class - by El Forum - 07-10-2007, 02:17 AM
Extending Model class - by El Forum - 07-10-2007, 03:19 AM
Extending Model class - by El Forum - 07-10-2007, 11:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB