Hi guys, I'm new to this,... and make a long story short I bought an
incomplete social network script... I need to add videos, blogs,
groups,... etc... and having problem to categories them... Found you
here in Google Groups,... What a great place to be... Thank you in
advance for your help and effort... Here we go...
What I have is:

<?php
class Video extends AppModel {
    var $name = 'Video';

         var $validate = array(
    'video_title' => VALID_NOT_EMPTY,
    'user_id' => VALID_NOT_EMPTY,
    'category_id' => VALID_NOT_EMPTY,
    'video_description' => VALID_NOT_EMPTY,
    'video_embed_code' => VALID_NOT_EMPTY
        );

        var $belongsTo = array(
                'VideoCategory' => array(
                        'className'     => 'VideoCategory',
                        'foreignKey'    => 'category_id'
                ),
                'User' => array(
                        'className'     => 'User',
                        'foreignKey'    => 'id'
                )
        );

        var $hasMany = array(
                'VideoComment' => array(
                        'className'     => 'VideoComment',
                        'foreignKey'    => 'video_id'
                ),
                'User' => array(
                        'className'     => 'User',
                        'foreignKey'    => 'id'
                )
        );

}
?>

and

<?php
class VideoCategory extends AppModel {
  var $name = 'VideoCategory';

  var $validate = array(
    'id' => VALID_NOT_EMPTY,
    'category_name' => VALID_NOT_EMPTY
  );


}
?>

in models....

I like to know how to display these categories in <form> fields e.g.
<?php echo $form->select('Video/category'), ..... and how to post that
video to belong to that category....  and  what I need to have in
videos_controller.php and .../views/videos/add.ctp for select box.

Thank you all
Salute
Chris


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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to