Welcome Guest, Not a member yet? Register   Sign In
Missing argument 1 for Layout::__construct(), called in C:\Xampp\htdocs\system\core\Loader.php on line 950 and defined
#1

[eluser]Unknown[/eluser]
I have started to create a new library called Layout and I have successfully loaded the library but somehow, it is not passing the arguments correctly and I received the following error message.

Code:
A PHP Error was encountered

Severity: Warning

Message: Missing argument 1 for Layout::__construct(), called in C:\Xampp\htdocs\system\core\Loader.php on line 950 and defined

Filename: libraries/Layout.php

Line Number: 17

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: layout

Filename: libraries/Layout.php

Line Number: 19

Below are the codes for the constructor.

Code:
class Layout {
    var $obj;
    var $layout;
    var $js;
    var $css;
    var $placeholder;

    public function __construct($layout) {
        $this->obj =& get_instance();
        $this->layout = $layout;
        $this->js = $this->css = $this->placeholder = array();
    }
}

Below are the constructor codes for my controller.

Code:
class Home extends MY_Controller {

    function __construct() {
        parent::__construct();
        $this->load->library('layout', 'home');    
    }
}

I appreciate who can help me in this. Thanks.


Messages In This Thread
Missing argument 1 for Layout::__construct(), called in C:\Xampp\htdocs\system\core\Loader.php on line 950 and defined - by El Forum - 06-19-2011, 06:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB