Home  >  Article  >  Backend Development  >  新手求助:symfony使用doctrine Persisting Objects to the Database出现问题

新手求助:symfony使用doctrine Persisting Objects to the Database出现问题

WBOY
WBOYOriginal
2016-07-06 13:51:33762browse

刚接触symfony:完全按照官网文档操作 createAction放在DefaultController.php中

下面提示需要设置路由才可以访问
我在createAction前加
/**

  • @Route("/api")
    */
    访问http://localhost/symfony/web/api 就会出错 不知道该如何设置这个路由可以前台访问 求帮忙谢谢

回复内容:

刚接触symfony:完全按照官网文档操作 createAction放在DefaultController.php中

下面提示需要设置路由才可以访问
我在createAction前加
/**

  • @Route("/api")
    */
    访问http://localhost/symfony/web/api 就会出错 不知道该如何设置这个路由可以前台访问 求帮忙谢谢

这个方法如何在外部直接调用呢 http://localhost/symfony/web/api 还有在其他方法如何调用呢? 麻烦哪位大哥帮我看啊

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn