Welcome Guest, Not a member yet? Register   Sign In
MY_Model - without autoload
#1

How can I disable autoload on MY_Model?
I have there few main methods, which I using in standard models.
Reply
#2

You can't disable that.
Reply
#3

So how can I extends my models? Normally create 'ForExtend_model.php' and in my models:
PHP Code:
class Users_model extends ForExtend_model {
//...

or how?
Reply
#4

If you don't need just remove the class file. If you need functionality from CI_Model class, then MY_Model has it too because it inherits from CI_Model.

Can you specify a use case?
Reply
#5

(02-17-2016, 04:55 PM)siburny Wrote: If you don't need just remove the class file. If you need functionality from CI_Model class, then MY_Model has it too because it inherits from CI_Model.

Can you specify a use case?

I have few models which I normally using and model to extends with methods for extends:
PHP Code:
class ToExtends_model extends CI_Model {
//... methods like
function GetWhereSingle$Table$WhereName$WhereValue ) {
 
     $this->db->where$WhereName$WhereValue );
      return $this->db->get$Table);
// end method


Now I want to extends my normal models with this, ex.
PHP Code:
class Users_model extends ToExtends_model 
but I still using CI_Model (AR)
Reply
#6

What has that got to do with MY_Model being loaded? It doesn't prevent you from inheriting other classes.
Reply
#7

(02-18-2016, 02:49 AM)Narf Wrote: What has that got to do with MY_Model being loaded? It doesn't prevent you from inheriting other classes.

My 'main' methods in this model (ForExtends) have parameters and I getting error on start app:
Code:
Parse error: syntax error, unexpected 'GetWhereSingle' (T_STRING), expecting variable (T_VARIABLE) in ... (file with 'ForExtends')
Reply
#8

That's a syntax error, nothing to do with MY_Model.
Also, why did you register a new username just to open this thread?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB