We all start somewhere...
Assuming the film name and colour are part of the same form, they will be
present in a variable called $this->data within the register action. Do this
when creating your form:
echo $this->Form->input('User.username');
echo $this->Form->input('Profile.film_name');
...then they will be in different parts of the $this->data array:
$this->data['User']['username']
$this->data['Profile']['film_name']
...so you can collect them there.
Post back if you need more help.
Jeremy Burns
Class Outfit
http://www.classoutfit.com
On 6 Jul 2011, at 16:41, [email protected] wrote:
> Hey there guys, sorry for my lack of knowledge here but I'm new to
> cakephp and while I've written the most basic php before I've never
> tried to do anything anywhere near complicated, so I'm out of my depth
> but loving learning all about cake.
>
> Basically my app will have users who will be able to create profiles
> pages. After clicking go on the homepage, they will see a screen with
> a form on it. The inputs will be username, email and password for the
> user model plus I want them to enter a film-name and a colour which
> will be part of profile model.
>
> They then click to submit and stuff gets submitted to my
> users_controller 'register' action which saves the user to the
> database etc and if all goes well redirects them to a page where they
> will enter more details. The trouble is I need to get access to the
> film-name and colour they entered before and I'm not sure how I should
> be handling that.
>
> Should I be trying to save their profile to the database at the same
> time as saving their user details? If so how do I do that since I'd be
> in the users_controller?
>
> I know I could ask for the user and profile details on separate
> screens but I really want them to choose their film and colour on the
> same screen as choosing their username. Plus I don't want to have to
> make film-name and colour part of the user model
>
> --
> 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