3

嘿,我正在处理 symfony2 项目并尝试使用注释创建路由,但出现错误,但是当我使用从 routes.yml 文件定义路由时,一切正常,但导致注释出现问题错误是

致命错误:Doctrine\ORM\Proxy\ProxyFactory::getProxy() [function.require]:打开失败需要'C:/wamp/www/idp_svn/app/cache/dev/doctrine/orm/Proxies\MunichInnovationGroupPatentBundleEntityUmUsersProxy.php' (include_path='.;C:\php\pear') 在第 85 行的 C:\wamp\www\idp_svn\vendor\doctrine\lib\Doctrine\ORM\Proxy\ProxyFactory.php

我的 app/congig/route.yml 是

 MunichInnovationGroupPatentBundle:
  resource: "@MunichInnovationGroupPatentBundle/Controller/"
  type:     annotation
  prefix:   /
  defaults:  { _controller: "MunichInnovationGroupPatentBundle:Default:index" }

  MunichInnovationGroupBundle:
   resource: "@MunichInnovationGroupBundle/Controller/"
   type:     annotation
   prefix:   /v1
   defaults:  { _controller: "MunichInnovationGroupBundle:Patent:index" }

   login_check:
    pattern:   /login_check

   logout:
    pattern:   /logout

在我的控制器中

  <?php
  namespace MunichInnovationGroup\PatentBundle\Controller;

  use Symfony\Component\HttpFoundation\Response;
  use Symfony\Component\HttpFoundation\Request;
  use JMS\SecurityExtraPatentBundle\Annotation\Secure;
  use Symfony\Component\Security\Core\Exception\AccessDeniedException;
  use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  use Symfony\Component\Security\Core\SecurityContext;

  use MunichInnovationGroup\PatentBundle\Entity\Log;
  use MunichInnovationGroup\PatentBundle\Entity\UserPatent;
  use MunichInnovationGroup\PatentBundle\Entity\PmPortfolios;
  use MunichInnovationGroup\PatentBundle\Entity\UmUsers;
  use MunichInnovationGroup\PatentBundle\Entity\PmPatentgroups;
  use MunichInnovationGroup\PatentBundle\Form\PortfolioType;
  use MunichInnovationGroup\PatentBundle\Util\SecurityHelper;
  use Exception;
  /**
   * Portfolio controller.
   * @Route("/portfolio")
 */
 class PortfolioController extends Controller {
 /**
  * Index action.
  *
  * @Route("/", name="v2_pm_portfolio")
  * @Template("MunichInnovationGroupPatentBundle:Portfolio:index.html.twig")
*/
public function indexAction(Request $request) {
$em = $this->getDoctrine()->getEntityManager("pp_userdata");
$em->getRepository('MunichInnovationGroupPatentBundle:PmPortfolios')
->findBy(array('user' => '$user_id'));

       // rest of the method
}

有任何想法吗?我做错了什么?

提前致谢

4

0 回答 0