I'm using Cloudinary to manage direct image uploads in my Sf2 application.
There's a Cloudinary helper function called "cl_image_upload_tag" that generates the upload form.
I need to run the function in my controller and display the results as raw code in my template. But I'm not able to access the function in my Controller
$cloud_form = \Cloudinary\Uploader::cl_image_upload_tag('image_id', array("callback" => $this->get("router")->generate("cloudinary_callback")));
(I will output $cloud_form in Twig as {{ cloud_form|raw }} )
I think this is a namespace issue but I can't make it work, it get "Error: Call to undefined method". Thanks!
Update: here's the autoload file:
<?php
use Doctrine\Common\Annotations\AnnotationRegistry;
use Composer\Autoload\ClassLoader;
/**
* @var $loader ClassLoader
*/
$loader = require __DIR__.'/../vendor/autoload.php';
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
return $loader;
Try to modify your
app/autoloader.php
file as followsFrom now on you should be able to refer to your class as
Cloudinary