Hello,
I used the Developer Tools latest version to generate Controller code for a class. It doesn't seem to be ok and doesn't work properly. I would like to understand the logic. Here is the default starting code generated of create
action of a class.
public function createAction()
{
if (!$this->request->isPost()) {
return $this->dispatcher->forward(array(
"controller" => "ro_relorder_t",
"action" => "index"
));
}
$ro_relorder_t = new RoRelorderT();
...
This takes me to index page every time I try to create a new record. I have a create.volt
(equivalent of new
). With above code in place it never executes. The same code exists in edit
action also. The code in Vokuro example with forms is different. That seems to work fine after customization.
public function createAction()
{
if ($this->request->isPost()) {
$ro_relorder_t = new RoRelorderT();
...
Can't I use the code generated by Developer Tools directly.
Regards, Amal