Welcome Guest, Not a member yet? Register   Sign In
extend core class to have constructor input parameters.
#7

[eluser]Aken[/eluser]
[quote author="Hummer" date="1334166282"] Hi Aken,

thanks for your reply.

I have taken a look at the core Loader class, model method. I cannot see how changing the model method in the loader class will fix the warnings. The warning is coming from where MY_Model is instantiated in the core/Common functions.

The actual model classes that extend MY_Model load with no problems.

[/quote]
You're right, the default CI_ or MY_Model class is instantiated in Common.php. However, you cannot utilize parameters in the constructor without modifying the Loader class. Take a look at the code - you'll see it only does new $model(). The advice above is good for fixing your warning, but you still need to add the ability to utilize those parameters.

Or, use the initialize() method as also suggested.


Messages In This Thread
extend core class to have constructor input parameters. - by El Forum - 04-09-2012, 07:50 PM
extend core class to have constructor input parameters. - by El Forum - 04-09-2012, 10:55 PM
extend core class to have constructor input parameters. - by El Forum - 04-11-2012, 10:37 AM
extend core class to have constructor input parameters. - by El Forum - 04-11-2012, 10:44 AM
extend core class to have constructor input parameters. - by El Forum - 04-11-2012, 10:57 AM
extend core class to have constructor input parameters. - by El Forum - 04-11-2012, 11:41 AM
extend core class to have constructor input parameters. - by El Forum - 04-11-2012, 05:57 PM



Theme © iAndrew 2016 - Forum software by © MyBB