Welcome Guest, Not a member yet? Register   Sign In
When creating an image class, it throws an error!
#1

(This post was last modified: 12-31-2019, 01:57 AM by videoproc.)

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
Reply
#2

You should load it like this:

PHP Code:
use Config\Services;

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


Works fine here.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(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();
Reply




Theme © iAndrew 2016 - Forum software by © MyBB