Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Call to undefined function cl_image_upload_tag() in element #12

Closed
robksawyer opened this issue Sep 13, 2013 · 4 comments
Closed

Comments

@robksawyer
Copy link

I'm trying to use this code inside of a CakePHP (latest version) element. And I'm having some issues (see the error below).

Error: Call to undefined function cl_image_upload_tag() 

You can see the full element code at [https://gist.github.com/robksawyer/4a95a0f6c11f71df432f].

I've also added the following to bootstrap.php and cl_image_tag is working in the views.

/**
 * Cloudinary CDN Setup
 */
App::import('Vendor', 'Cloudinary/Cloudinary.php');
App::import('Vendor', 'Cloudinary/Uploader.php');
App::import('Vendor', 'Cloudinary/Api.php');

$cloudinaryURL = parse_url(getenv('CLOUDINARY_URL'));
define('CLOUD_NAME', $cloudinaryURL['host']);
Cloudinary::config(array( 
    "cloud_name" => $cloudinaryURL['host'], 
    "api_key" => $cloudinaryURL['user'], 
    "api_secret" => $cloudinaryURL['pass']
));
/**
 * End Cloudinary CDN Setup
 */

Any ideas?

@TalLevAmi
Copy link
Contributor

cl_image_upload_tag is defined in the global namespace. You might be calling it within another namespace. Try to use \cl_image_upload_tag.

@robksawyer
Copy link
Author

Thanks, but that didn't seem to work. :(

On Sep 15, 2013, at 4:14 AM, Tal Lev-Ami notifications@github.com wrote:

cl_image_upload_tag is defined in the global namespace. You might be calling it within another namespace. Try to use \cl_image_upload_tag.


Reply to this email directly or view it on GitHub.

@robksawyer
Copy link
Author

It's weird that cl_image_tag does work, though.

@TalLevAmi
Copy link
Contributor

Moving discussion to cloudinary_php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants