CodeIgniter Forums

Full Version: When creating an image class, it throws an error!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi! 
When creating an image class, it throws an error!!!

Code:
$image = Config\Services::image();

Error

Class 'App\Controllers\Config\Services' not found

CI version 4.0.0-rc.3
You should load it like this:

PHP Code:
use Config\Services;

class 
SomeClass
{
    public someMethod
    
{
        $image Services::image();
    }


Works fine here.
(12-31-2019, 01:56 AM)videoproc Wrote: [ -> ]Hi! 
When creating an image class, it throws an error!!!

Code:
$image = Config\Services::image();

Error

Class 'App\Controllers\Config\Services' not found

CI version 4.0.0-rc.3

Try a fully-qualified namespace. (note the slash before Config)

Code:
$image = \Config\Services::image();