In fact, I'm doing right that at the moment (and some other
functionalities in other components that alltogether do really good
job in allowing even more RAD). :-)

I guess as soon as they are real-life-proven, I will publish them.

On Tue, Dec 14, 2010 at 4:11 PM, euromark <dereurom...@googlemail.com> wrote:
> i would even create a component and pass a "whitelist" of valid field
> names
> this way you can use the code in several controllers and actions :)
>
>
> On 14 Dez., 08:49, Joshua Muheim <psybea...@gmail.com> wrote:
>> Thanks for this nice hint, Mark. I'll place it there. :-)
>>
>>
>>
>>
>>
>>
>>
>> On Tue, Dec 14, 2010 at 12:19 AM, euromark <dereurom...@googlemail.com> 
>> wrote:
>> > you should do that in the action
>> > in the else part of if (!empty($this->data)):
>>
>> >http://www.dereuromark.de/2010/10/07/cakephp-beginner-tips/
>>
>> > On 13 Dez., 16:59, psybear83 <psybea...@gmail.com> wrote:
>> >> Hey guys
>>
>> >> I'm creating a form using the Form helper, and I'd like to send
>> >> default values using named params:
>>
>> >> /users/add/first_name:max/last_name:miller
>>
>> >> I've already come so far that the input() accepts default values for
>> >> text fields and dropdown lists:
>>
>> >> echo $this->Form->create(null, array('url' => '/'.$this->params['url']
>> >> ['url']));
>> >> foreach($scaffoldFields as $field) {
>> >>   $selected = null;
>> >>   if(empty($this->data) && isset($this->params['named'][$field])) { //
>> >> When there's no data present (sent using POST or loaded from the
>> >> database), then apply any default values from named parameters!
>> >>     $selected = $this->params['named'][$field];
>> >>   }
>> >>   echo $this->Form->input($field, array('selected' => $selected,
>> >> 'default' => $selected)); // TODO: Not very nice to have both selected
>> >> (dropdown) and default (text) keys here...!}
>>
>> >> echo $this->Form->end(__('Submit', true));
>>
>> >> But I'm unsure on how to implement this for checkboxes and multi
>> >> select lists? For this I'd have to know what sort of field the helper
>> >> creates, and then e.g. I could send an array of values as default.
>>
>> >> Is there an easy way to examine what sort of input field will be
>> >> created by the Form helper?
>>
>> >> Thanks,
>> >> Josh
>>
>> > 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 cake-php@googlegroups.com
>> > To unsubscribe from this group, send email to
>> > cake-php+unsubscr...@googlegroups.com 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 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
>

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