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

[eluser]Hummer[/eluser]
Is it possible to extend a core class to have input parameters in the constructor?

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Model extends CI_Model {

var $input_parms = "";

public function __construct( $params )
{
$this->input_parms = $parms;
parent::__construct();

}
}


When I do this I get this warning:


Severity: Warning

Message: Missing argument 1 for MY_Model::__construct(), called in /var/www/html/codeigniter/system/core/Common.php on line 174 and defined

Filename: core/MY_Model.php

Line Number: 47




Should I be concerned about the warning?

Is the extended class incorrect?



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