Вы можете установить базовую маршрутизацию для вашего ForumBundle. Здесь используются аннотации:
/**
* Forum controller
*
* @Route("/articles/showforum/forum")
*/
class ForumController extends Controller
{...
Базовый метод editAction:
\ForumBundle\ForumController.php
public function editAction($id)
{
$this->editCustom(id);
return array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
);
}
public function editCustom(id)
{
$em = $this->getDoctrine()->getEntityManager();
$entity = $em->getRepository('ForumBundle:Topic')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Topic entity.');
}
$editForm = $this->createForm(new TopicType(), $entity);
$deleteForm = $this->createDeleteForm($id);
}
\ArticlesBundle\ForumController.php
public function editAction($id)
{
\ForumBundle\Controller\ForumController::editCustom(id);
return array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
);
}