You don't want to change anything in the view (which is where the call
to $this->Form will be)
you need to take a look in the controller for the view. Then find
where the gallery_id data is currently being pulled out and add a
condition to it, so you'd have something like the following the in
controller
$this->Model->find('list',array("conditions" => array('model.user_id'=>
$userId])));
Replacing Model and the references to userid to whatever you are
using.
On Jun 23, 5:31 am, 09030032 <[email protected]> wrote:
> there is a photos table and a galleries table.
>
> every photo belongsTo a gallery
>
> both tables have a field userID which tells which user created this
> gallery or uploaded this photo.
>
> how do i convert :
>
> echo $this->Form->input('gallery_id');
>
> to something like :
>
> echo $this->Form->input( gallery_id WHERE userId_of_gallery ==
> $userId );
>
> this will ensure that when adding photos to an album... the drop down
> menu in the view file only shows that galleries which were created by
> currently logged in user ( $userId is the userId of currently loggen
> in user)
--
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