0

I'm facing this problem with Cloudinary on php:

I've copy/paste the documentation of search :

 $result = \Cloudinary\search   ->expression('resource_type:image')  
 ->sort_by('public_id','desc')   ->max_results(30)   ->execute();

And it returns this error :

Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR)

I've tried with uploading and it works fine, the syntax of uploading is quite different:

$result = \Cloudinary\Uploader::upload($file, $options = array());

But if tried accesing this way to search and it gives scope's errors :

$result = \Cloudinary\Search :: execute();

Fatal error: Using $this when not in object context in /var/www/mymoda.tj.net/htdocs/2.0/inc/cloudinary/Search.php on line 78

Miguel
  • 43
  • 3

1 Answers1

0

Try to add parentheses after search(search()) since it is a function:

 $result = \Cloudinary\search()->expression('resource_type:image')  
 ->sort_by('public_id','desc')->max_results(30)->execute();

Maybe they misspelled it in the documentation.

András
  • 456
  • 3
  • 9