I have a form for gathering an email address, which corresponds to my User model. I'd like the form to also have a text field for an email message, but I don't need the message saved to my database.
echo $this->Form->create('User', array('action' => 'invite','controller' => 'users'));
echo $this->Form->input('User.from', array('label'=>"Your email",'value'=>'your email','class'=>"",'type'=>'email'));
echo $this->Form->input('User.to', array('label'=>"Your friend's", 'value'=>"your friend's email",'class'=>"",'type'=>'email'));
echo $this->Form->textarea('User.message', array('label'=>'Your message', 'value'=>"some message"));
echo $this->Form->end(array('label'=>'Invite', 'class'=>'buttonstyle'));
This works, but only if I add a message column to my Users table, which I don't need. I'd rather do something like this
echo $this->Form->textarea('message', array('label'=>'Your message', 'value'=>"some message"));
But that doesn't work, I guess because "message" isn't associated with a model. Is there a better way to do this?