Hi all,
So I think I've cornered the issue at this point. I was trying to put
the following in my app/config/core.php:
Configure::write('Favorites.types', array('favorite' => 'Photo',
'follow' => 'User'));
Configure::write('Favorites.defaultTexts', array('favorite' =>
__('Favorite it', true),'follow' => __('Follow this user', true)));
Configure::write('Favorites.modelCategories', array('Photo',
'User'));
But it caused Cake to give me a "Missing Controller" error. I can
only assume that this code causes Cake to look for a controller called
Favorites in the app/controllers/ directory instead of app/plugins/ .
When I remove this code, I can use my Favorites plugin at localhost/
favorites/favorites/add/ and this will point to the add.ctp view.
However, add() in the Favorites model requires data from
Favorites.types, Favorites.defaultTexts, and
Favorites.modelCategories. Therefore, I need to find a place for
these Configure::write() statements.
Anyone have any ideas? I can't seem to find the appropriate place for
them.
Thanks,
Jonathan
On Oct 15, 5:52 pm, Jonathan Sibley <[email protected]> wrote:
> Hey all,
>
> Anyone have any ideas? I have been trying this on my local server,
> but I uploaded it just now to a webserver, and I'm getting the same
> results. Anyone have any idea where to look? I feel like I've looked
> everywhere at this point and searched all possible keywords on this
> group and Google that I can think of.
>
> Thanks,
> Jonathan
>
> On Oct 14, 10:41 pm, Jonathan Sibley <[email protected]> wrote:
>
>
>
> > Hey all,
>
> > It seems as though I get the "Missing Controller" error for all
> > plugins. For example, if I bake a plugin called "test" (in console:
> > "cake bake plugin test"), it creates test_app_controller.php and
> > test_app_model.php in app/plugins/test/. Then, I create
> > test_controller.php in app/plugins/test/controllers/ and a
> > test_model.php in app/plugins/test/models/, I still get the "Missing
> > Controller" error. Could this be a problem with my system
> > configuration? I'm running XAMPP 1.7.3 on Windows 7, in case that
> > helps. I've also tried downloading a fresh copy of the cake/ folder
> > and it doesn't help. I've also tried putting my "favorites" plugin
> > directory in both cake/plugins and app/plugins.
>
> > Thanks,
> > Jonathan
>
> > On Oct 14, 9:13 pm, Jonathan Sibley <[email protected]> wrote:
>
> > > 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