Symfony:添加新的操作/视图错误。 (新手问题)
我在尝试添加新模块页面时收到 404 错误。作为 Symfony 的新手,我显然错过了一些基本的东西。谁能指出我错过了什么?
非常感谢。
module/admin/actions/actions.class.php
/* following executeIndex() */
public function executeSchedule()
{
if ($this->getRequest()->getethod() != sfRequest::POST)
{
return sfView::SUCCESS;
}
else
{
$name = $this->getRequestParameter('first_name');
echo $name;
}
}
module/admin/templates/scheduleSuccess.php
<?=set_title('Schedule')?>
<form action="/admin/schedule" method="POST">
<input name="foo" type="text">
<?php echo submit_tag('Schedule'); ?></p
提交后,我收到此错误:
Sep 28 10:02:37 symfony [info] {sfAction} call "defaultActions->executeError404()"
Sep 28 10:02:37 symfony [warning] {404} requested url: /admin/schedule
Sep 28 10:02:37 symfony [info] {sfView} initialize view for "default/error404"
I'm getting a 404 when trying to add a new module page. I'm apparently missing something fundamental here, being a newbie to Symfony. Can anyone point out what it is I'm missing?
Many thanks.
modules/admin/actions/actions.class.php
/* following executeIndex() */
public function executeSchedule()
{
if ($this->getRequest()->getethod() != sfRequest::POST)
{
return sfView::SUCCESS;
}
else
{
$name = $this->getRequestParameter('first_name');
echo $name;
}
}
modules/admin/templates/scheduleSuccess.php
<?=set_title('Schedule')?>
<form action="/admin/schedule" method="POST">
<input name="foo" type="text">
<?php echo submit_tag('Schedule'); ?></p
Upon submit, I get this error:
Sep 28 10:02:37 symfony [info] {sfAction} call "defaultActions->executeError404()"
Sep 28 10:02:37 symfony [warning] {404} requested url: /admin/schedule
Sep 28 10:02:37 symfony [info] {sfView} initialize view for "default/error404"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
另外,不要在你的行动中附和。使用 setContent 帮助器。
在你的情况下:
Also, don't echo in your actions. Use the setContent helper.
In your situation: