Skip to content

Commit

Permalink
カテゴリー編集完了のイベントでフォームを新規パラメータとして渡す
Browse files Browse the repository at this point in the history
  • Loading branch information
dk-umebius committed Jul 20, 2019
1 parent c124a6d commit 91580d9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Eccube/Controller/Admin/Product/CategoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ public function index(Request $request, $parent_id = null, $id = null, CacheUtil

log_info('カテゴリ登録完了', [$id]);

// $formが保存されたフォーム
// 下の編集用フォームの場合とイベント名が共通のため
// このイベントのリスナーではsubmitされているフォームを判定する必要がある
$event = new EventArgs(
[
'form' => $form,
Expand All @@ -153,9 +156,13 @@ public function index(Request $request, $parent_id = null, $id = null, CacheUtil
if ($editForm->isSubmitted() && $editForm->isValid()) {
$this->categoryRepository->save($editForm->getData());

// $editFormが保存されたフォーム
// 上の新規登録用フォームの場合とイベント名が共通のため
// このイベントのリスナーではsubmitされているフォームを判定する必要がある
$event = new EventArgs(
[
'form' => $editForm,
'form' => $form,
'editForm' => $editForm,
'Parent' => $Parent,
'TargetCategory' => $editForm->getData(),
],
Expand Down

0 comments on commit 91580d9

Please sign in to comment.