Namespace in PHP Codeigniter Framework

Namespace in PHP CodeIgniter Framework

Namespace are supported by php and not by the framework (codeigniter in your case). If you use namespaces php version must be >= 5.3.0
Codeigniter dosen`t use namespaces because it is written to support php 4.

PHP namespace error

What you want to set up is what is called auto loading. If you name your files correctly it will properly load them as needed.

There's a standard for it called PSR-0, which you can read about about at https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md

You also have a sample implementation there.



Related Topics



Leave a reply



Submit