Wednesday, March 31, 2010

Re: App::import - not working, how to bugtrace

On Mar 31, 7:36 pm, schizophrenie <yaf...@yahoo.de> wrote:
> Hi  @ all,
>
> i was following up a googlemap tutorial, i've recognized that the code
> is old, so i've updated nearly everything but one thing isn't
> working.
>
> instead of vendor('googlegeo')  i am using  App::import('Vendor',
> 'googlegeo')
> but i think its not loading, because my class within is not
> recognized,

Are you sure that the class name is 'googlegeo'? Check the case.

Try also giving the path to the file:

App::import('Vendor', 'googlegeo', array('file' => PATH))

Where PATH is the path to the file from the vendors dir, ie if it's in
app/vendors/google/google_geo.php you specify 'google/google_geo.php'
as the path.

> i've also tried it with App::import('Controller', 'Users')
> to create a new UsersController, which has also failed.

That class name should be UsersController.

> how can i test if my app is loading the file?

$googlegeo = new googlegeo(); //or whatever the actual class name is

If that fails spectacularly, your file wasn't loaded.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.

No comments: