Re: Good idea to combine edit.thtml and add.thtml?

2007-01-22 Thread Barton
Thanks RichardAtHome, this was exactly what I was mean with combining the forms. It's great to see that 1.2 will make coding with CakePHP even more pleasant! Keep up the good work! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Good idea to combine edit.thtml and add.thtml?

2007-01-21 Thread Barton
I wonder whether it's a good idea to combine the 'add' and 'edit' forms into one form. What's your opinion about this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send

Re: Good idea to combine edit.thtml and add.thtml?

2007-01-21 Thread Larry E. Masters aka PhpNut
Barton, This is how the core scaffold uses one form template. The code below is from 1.1.x.x branch. snips are from different files but it should give you a good idea how to accomplish this. controller file: $form = 'Edit'; if ($type === 'add') { $form = 'Add'; }

Re: Good idea to combine edit.thtml and add.thtml?

2007-01-21 Thread 2000Man
Hi Barton, I usually have two methods in my controller: add (or create) and edit. In these methods I use $this-render('form'). In my form.thtml I have ?=$html-formTag('/'.Inflector::underscore($this-name).'/'.$this-action);? and of course ?=$html-hidden('Modelname/id'); ? (needed for

Re: Good idea to combine edit.thtml and add.thtml?

2007-01-21 Thread [EMAIL PROTECTED]
In my views I do one better and incorporate a type of 'view' as well - with things like $form = and $disabled = disabled So I can re-use one view for all 3 modes. Steve Truesdale On Jan 21, 3:37 pm, Larry E. Masters aka PhpNut [EMAIL PROTECTED] wrote: Barton, This is how the core

Re: Good idea to combine edit.thtml and add.thtml?

2007-01-21 Thread nate
http://cake.insertdesignhere.com/posts/view/15 Read the comments. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from

Re: Good idea to combine edit.thtml and add.thtml?

2007-01-21 Thread RichardAtHome
If you set the action property of the form to empty ( ) then the form will post back to the page that it was rendered on. Handy if you are passing parameters through the url. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the