0

In my cake app a need Imagine but how I can create instance of class Imagine in Controller.

Plugin was install by composer and all files are in vendor folder.

This:

 require 'vendor/autoload.php';
 $imagine = new Imagine\Gd\Imagine(); 

doesn't work.

I get:

require(vendor/autoload.php): failed to open stream: No such file or directory [APP/Controller\ArticlesController.php, line 100] Fatal error: require() [function.require]: Failed opening required 'vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\cakephp_blog\src\Controller\ArticlesController.php on line 100

Dave
  • 3,073
  • 7
  • 20
  • 33
mcek
  • 480
  • 7
  • 17
  • Try with backslash `'vendor\autoload.php'` I think you are in windows and this path is for linux. – Niklesh Raut Jul 25 '16 at 13:07
  • If things have been installed correctly, you don't need a "require" at all. The `autoload.php` should be included automatically by Cake, meaning you can go ahead and just create the object. – Greg Schmidt Jul 25 '16 at 22:33
  • Ok it's work but only in model table file when I add behaviour but why? In controller app doesnt see imagine class I have a lot of problems with plugins. – mcek Jul 28 '16 at 11:08

0 Answers0