Hello, I'm not sure if I've reached the right outlet for support, but I will
explain my problem. And thank you for any help you may provide!
I'm pretty new to CakePHP, and I'm trying to get the Favorites plugin (by
CakeDC.org) working on my site. My problem currently is that I can't
"toggleFavorite" in my app/views/photos/view.ctp. My "view" helper displays
a photo and allows the user to "favorite it" with:
===========
echo $this->Favorites->toggleFavorite('favorite', $photo['Photo']['id']);
===========
This renders a link, but when I click the link, it goes to
example.com/favorites/favorites/add/favorite/94 (94 is the "id" of the
Photo):
============
Missing Controller
Error: FavoritesController could not be found.
Error: Create the class FavoritesController below in file:
app\controllers\favorites_controller.php
===========
I read on the book.cakephp.org "Plugin Tips" page that a common cause of the
"Missing Controller" error is to not have a favorites_app_controller.php and
favorites_app_model.php in the /app/plugin/favorites/ directory. I have
them, and they extend "AppController" and "AppModel" respectively.
Likewise, my app/plugins/favorites/controllers/favorites_controller.php
extends "FavoritesAppController" and
my app/plugins/favorites/models/favorite.php extends "FavoritesAppModel".
For those of you who are familiar with this plugin, here is some more
information on my set-up. I have placed the following in
app/config/core.php:
===========
Configure::write('Favorites.types', array('favorite' => 'Photo', 'follow' =>
'User'));
Configure::write('Favorites.defaultTexts', array('favorite' => __('Favorite
it', true),'watch' => __('Follow it', true)));
Configure::write('Favorites.modelCategories', array('Photo', 'User'));
===========
Other than that, I have copied the files I downloaded from the Github page
into my app/plugins/favorites/
Thanks in advance for any help you can provide!
Best,
Jonathan Sibley
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 [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en