I won't get into the actual coding on how to do it but it's quite simple
really.
One approach is -> User $hasMany Favorites

When loading a page that contains the possible "favorite"
have the controller use containable behavior and pass
the current session user info containing their favorites list into the
view.
If the active record is in the users list of favorites, display the "remove
button"
if not in the list ... display "add" button.

http://book.cakephp.org/view/1039/Associations-Linking-Models-Together
http://book.cakephp.org/view/1323/Containable




On Mon, Feb 7, 2011 at 11:21 PM, [email protected] <[email protected]>wrote:

> Hi guys,... How u all doinnnn...
> Needless to say "...I Love You All ! " What A Wonderful Group ... !
>
> I still have problems on Favorite issues,...
> Once the User favorite say some group, or video,...
> the button to "Add to Favorites" MUST BE REPLACED WITH "Remove
> Favorites"
> I want to know how to make that statement in php... I don't know
> how... lol I'm still a newbie,... but have some experiance from long
> time ago. And what I'm doing is creating Social Network site, and with
> little or no knowlllege at all do so far this much. Can you PLEASE
> help me with my project??
>
> Or anyone... ??
>
> Here is my question again:
>
> <?php if( WHAT THE HELL IS IN HERE ??? oopps... ($group['Group']
> ['id'])): ?>
>
> Thanks
> Chris
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to