2017-05-06 2 views
0

내가 직접 그심포니 : 폼 공장 작업은

같은 조치 I했으나, 내 양식 공장의 선택의 여지가 고정 경로 관련 컨트롤러 액션

은 "개체 삭제"로 양식 공장을하고 싶습니다 $ 경로 [ 'admin_category_delete가']가 삭제 엔티티 제어기 경로 및 방법

/** 
* Creates a form to delete the given Category entity. 
* 
* @param array $paths 
* 
* @return FormInterface 
*/ 
private function createDeleteForm(array $paths) { 
    $formFactory = $this->get('cms_category.form_factory.delete_category'); 

    return $formFactory->createForm(array('action' => $paths['admin_category_delete'], 'method' => 'DELETE')); 
} 

는 그런 방법 인 제 FormFactory 예에서

사용되어야하는 것이다 :

/** 
* todo - update method to PATCH in Rest Api 
* 
* {@inheritdoc} 
*/ 
public function createForm($options = array('method' => 'DELETE')) { 


    $builder = $this->formFactory->createNamedBuilder($this->name, $this->type, NULL, $options); 

    return $builder->getForm(); 
} 

답변

0

좋은 연습 이었지만 실제 문제는 달랐습니다.