0

我的控制器中有这段代码:

namespace BankBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use BankBundle\Entity\Account;
use BankBundle\Entity\AccountType;
use BankBundle\Form\AccountType;

也有这个方法:

/**
 * Show created bank account
 *
 * @Route("/account/show/{account_id}", name="wba_show")
 * @Method("GET")
 */
public function showBAAction($account_id) {
    $em = $this->getDoctrine()->getManager();
    $entity = $em->getRepository('BankBundle:Account')->find($account_id);

    if (!$entity) {
        throw $this->createNotFoundException('Unable to find Account entity.');
    }

    $deleteForm = $this->createDeleteForm($account_id);
    return array('entity' => $entity, 'delete_form' => $deleteForm->createView());
}

当我调用/account/show/1我直接获得异常的 URL 时,为什么?我想包括一些东西?

4

0 回答 0