|
@@ 94-104 (lines=11) @@
|
| 91 |
|
$creator = $this->getFormCreator(); |
| 92 |
|
$form = $creator->create()->handleRequest($this->getRequest()); |
| 93 |
|
|
| 94 |
|
if ($form->isSubmitted()) { |
| 95 |
|
$this->validate($form); |
| 96 |
|
$this->validateNew($form); |
| 97 |
|
if ($form->isValid()) { |
| 98 |
|
$model = $creator->enter($form); |
| 99 |
|
$this->getFlashBag()->add("success", |
| 100 |
|
$this->getMessage($model, 'create', 'success')); |
| 101 |
|
|
| 102 |
|
return $this->redirectTo($model); |
| 103 |
|
} |
| 104 |
|
} |
| 105 |
|
|
| 106 |
|
return array("form" => $form->createView()); |
| 107 |
|
} |
|
@@ 130-139 (lines=10) @@
|
| 127 |
|
$creator = $this->getFormCreator($model); |
| 128 |
|
$form = $creator->create()->handleRequest($this->getRequest()); |
| 129 |
|
|
| 130 |
|
if ($form->isSubmitted()) { |
| 131 |
|
$this->validate($form); |
| 132 |
|
if ($form->isValid()) { |
| 133 |
|
$creator->update($form, $model); |
| 134 |
|
$this->getFlashBag()->add("success", |
| 135 |
|
$this->getMessage($model, 'edit', 'success')); |
| 136 |
|
|
| 137 |
|
return $this->redirectTo($model); |
| 138 |
|
} |
| 139 |
|
} |
| 140 |
|
|
| 141 |
|
return array("form" => $form->createView(), $type => $model); |
| 142 |
|
} |