我是symfony的新手,在AcmeDemo之后,我为联系我们创建了一个新页面。 目前它正在为url localhost:8000 / contactus工作,但是遵循相同的demo / secured / login实现,它应该是localhost:8000 / demo / contactus,它给出了404。 p>
我不确定我在做什么。 p>
routing.yml strong> p>
ContactusController strong> p>
< pre>
_demo_contactus:
resource :“@ AcmeDemoBundle / Controller / ContactusController.php”
type:annotation
code> pre>
&lt;?php
namespace Acme \ DemoBundle \ Controller;
use Symfony \ Bundle \ FrameworkBundle \ Controller \ Controller;
use Sensio \ Bundle \ FrameworkExtraBundle \ Configuration \ Route;
use Sensio \ Bundle \ FrameworkExtraBundle \ Configuration \ Template;
class ContactusController扩展Controller
{
/ **
* @Route(“/ contactus”,name =“_ demo_contactus”)
* @Template()
** /
公共函数indexAction()
{
返回array();
}
}
?&gt;
code> pre>
< p>然后我有了我的观点,我确信这是正确的。 请提供详细的答案,以便它也可以帮助我清理我的概念。 谢谢!!! p>
div>