>>> [EMAIL PROTECTED] 05/12/06 5:46 AM >>>
if you set in $this->data['Model']['field']
then the html helper will add the value to the field
you can use $html->tagValue('Model/field'); if you need the default
data for something else.
so in your add form for example
function add()
{
if(empty($this->data)
{
$this->data['Model']['field1'] = 'default for field1';
}
else.....
// form has posted
}
now in the view $html->input('Model/field1); the default value will
be "default of field1"
-----------------------------------------------
Actually, I was wading around in the code yesterday, and I think I'd implement
default values in the "add" view. The calls to the HTML helper all generally
have the ability to process defaults.
David
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---