Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoload psr4 is not right. #1205

Closed
ghost opened this issue Sep 7, 2018 · 1 comment
Closed

autoload psr4 is not right. #1205

ghost opened this issue Sep 7, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Sep 7, 2018

class Autoload extends \CodeIgniter\Config\AutoloadConfig
{
	public $psr4 = [
		 'Modules' => ROOTPATH.'modules'
	];

        public function __construct()
	{
                print_r($this->psr4);   //here is good
		parent::__construct();
                print_r($this->psr4);  //here is error. no   'Modules' => ROOTPATH.'modules'
@lonnieezell
Copy link
Member

That's because the psr4 array gets defined below that, in the constructor. Add your Modules to the existing place in the constructor that's setting psr4 value and it all works just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant