PHP says variables are undefined when they aren't -
i'm working on small framework projects develop, when set testing index page call class, says variables undefined. index looks this:
error_reporting(e_all); ini_set("display_errors", 1); require_once('settings.php'); $base = $settings['basedir']; require_once($base.'/framework.php'); $cframe = new cframe($base, $settings);
and framework.php looks this:
class cframe { public function __construct($base, $settings){ $this->basedir = $base; $this->settings = $settings; require_once($this->basedir.'/db.php'); require_once($this->basedir.'/layout.class.php'); $this->layout = new layoutfinder($this->basedir.'/layout'); $this->db = new database; $this->dbc = $db->connectdb(); echo $basedir; } }
the error messages when trying run are:
warning: missing argument 1 cframe::__construct(), called in /var/www/cframe/coreframe/framework.php on line 11 , defined in /var/www/cframe/coreframe/framework.php on line 5
warning: missing argument 2 cframe::__construct(), called in /var/www/cframe/coreframe/framework.php on line 11 , defined in /var/www/cframe/coreframe/framework.php on line 5
notice: undefined variable: base in /var/www/cframe/coreframe/framework.php on line 6
notice: undefined variable: settings in /var/www/cframe/coreframe/framework.php on line 7
which saying variables not defined, are.
the problem db
child class of cframe
, means wouldn't have been able call inside parent class trying to.
Comments
Post a Comment