Class not found when CI_ENVIRONMENT = development |
I have this library app/Libraries/resize_image/ResizeImage.php
Code: namespace App\Libraries; I'm using it in a Controller : Code: <?php Everything works well if I don't set CI_ENVIRONMENT in .env file (or set it to production), but if I set it to development I get this error : Code: Class 'App\\Libraries\\ResizeImage' not found I'm using version 4.1.2 Anyone has a clue please? PHP Code: // you need to load it What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Show me how you registered the library?
Because app/Libraries/resize_image/ResizeImage.php cannot be accessed through the App\Libraries\ResizeImage namespace without first linking that namespace and file.
Always create istance of class to use it any where and this way you call fuction for static method nnot for that
Enlightenment Is Freedom
Could it be that your class is saved to a directory not respecting PSR-4?
(05-22-2021, 04:00 AM)paliz Wrote: Always create istance of class to use it any where and this way you call fuction for static method nnot for that Instantiating a class is not needed if you will just need to access a static method.
Thanks everyone, I finally got it!
The sub-folder was not name respecting PSR-4 and I needed the create the instance of the classe |
Welcome Guest, Not a member yet? Register Sign In |