Re: form autopopulation

2011-12-15 Thread Tilen Majerle
If uou populate data array in your controller than form helper will look for this data and populate field with the same name as data key Dne ponedeljek, 12. december 2011 je poĊĦiljatelj Anton Shevchenko < 2tamt...@gmail.com> napisal: > Hello, I'm new to CakePhp and don't understand the next thing

Re: form autopopulation

2011-12-12 Thread euromark
the usual recommendation: you should use the bake script to bake your code: "cake bake ..." from the console. this way you save time and learn a lot more than doing it the hacky way yourself (besides the fact that it should prevent you from writing unsafe/ faulty code) On 12 Dez., 15:42, Tilen M

Re: form autopopulation

2011-12-12 Thread Tilen Majerle
you need to populate data array in your controller Cake 1.3: $this->data = array('ModelName' => array('key1' => 'value1')); Cake 2.0: $this->request->data = array('ModelName' => array('key1' => 'value1")); and then in form helper in 'create' method first parameter is default ModelName and when you

form autopopulation

2011-12-12 Thread Anton Shevchenko
Hello, I'm new to CakePhp and don't understand the next thing: I'm going through the blog example I have created 2 different Views for my blog posts One is view.ctp and the other is edit.ctp they are similair Post Form->create('Post', array('action'=>'edit')); echo $this->Form->input('title');