Wow - Jeremy you are the man with many awesome suggestions.

This is my first BIG project using cake (which is amazing) so I am
trying to do it all.  I thought I would get the app working and then
go back and add all the goodies.  It seems every time I look through
the book (1 million times a day) I find yet another method I will need
to add.  Ugh:)

Right now I am focusing on my User model.  Anyway - I digress.

Here is the array:

Array
(
    [User] => Array
        (
            [email_address] => [email protected]
            [id] => 28
        )

Jeremy - thank you for the time.  I do appreciate you and everyone on
this site for that matter for all of the guidance and look forward to
the day I can help newbies.

Brad


On May 19, 9:49 pm, Jeremy Burns <[email protected]> wrote:
> Cake find results are always (he says, sticking his neck out!) arrays, so 
> even if you cracked your second challenge, you're still going to get an 
> array. I'd suggest refining the first find example (as it works) so that the 
> resulting array is smaller.
>
> Can you post the contents of the array here? Use - die(debug($email)); - to 
> get the contents. I notice that you are not using either recursive or the 
> Containable behaviour. We might be able to advise you how to incorporate 
> those.
>
> I'd probably also suggest making this a model function, and let the model 
> strip out the value you need from the array and return a single value.
>
> Jeremy Burns
> [email protected]
>
> On 20 May 2010, at 03:17, bradmaxs wrote:
>
>
>
> > I want to send an email with the email component.  No problem there.
>
> > However, I don't want it to be a hidden field in the form so I thought
> > I could do something in the controller.
>
> > So I did this line:
>
> > $email = $this->User->find('first', array('conditions' =>
> > array('User.id' => $this->data['Friend']['friend_id']), 'fields' =>
> > 'User.email_address'));
>
> > Which to my surprise (still learning all of these functions) it did
> > get the email address but the find function turns the info into an
> > array and then the email component has an array to deal with rather
> > than the specific string (email_address).
>
> > I thought I could use the field() method but I am confused as to how
> > to get it to work and there isn't much documentation.
>
> > I tried:
>
> > $email = User->field('email_address', array('id' => $this-
> >> data['Friend']['friend_id']));
>
> > and got:
>
> > Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /var/www/
> > vhosts/theactorstoolkit.com/httpdocs/app/controllers/
> > users_controller.php  on line 69
>
> > which shows up on the screen before I even get to the page.
>
> > I tried:
>
> > $email = $model->field('email_address', array('id' => $this-
> >> data['Friend']['friend_id']));
>
> > and once I submit the form it gives me:
>
> > Notice (8): Undefined variable: model [APP/controllers/
> > users_controller.php, line 69]
>
> > Anyone know how this should be done.
>
> > Thank you!
>
> > Brad
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 
> > athttp://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 
> athttp://groups.google.com/group/cake-php?hl=en

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

Reply via email to