2010-08-10 54 views
0

我在Symfony的Jobeet教程的day 10。一切工作很好,但是当我试图去索引页:http://localhost:9090/frontend_dev.phpSymfony的Jobeet找不到索引页面?

我得到了以下信息:

sfPatternRouting Match route "job" (/job.:sf_format) for /job with parameters array ('module' => 'job', 'action' => 'index', 'sf_format' => 'html',) 
2 Info sfFrontWebController Action "job/index" does not exist 
3 Error sfError404Exception Action "job/index" does not exist. 

(我仍然有9个一天中的备份和索引页正常工作) 。

有什么建议吗?

回答

1

我想你已经将app/modules/job/actions.class.php中的方法替换为你在第10天发现的内容,而不是简单地添加它们。如果你想在/工作的东西必须有这个文件的executeIndex()方法

+0

这是问题所在。该死,我刚刚在教程中看到“简化”一词,我想我必须删除所有内容。谢谢! – alexchenco 2010-08-11 05:47:08

1

是的,它是这样的:

class jobActions extends sfActions 
{ 
    public function executeIndex(sfWebRequest $request) 
    { 
    $this->categories = Doctrine_Core::getTable('JobeetCategory')->getWithJobs(); 
    } 

    public function executeShow(sfWebRequest $request) 
    { 
    $this->job = $this->getRoute()->getObject(); 
    } 

    public function executeNew(sfWebRequest $request) 
    { 
    ... 
    } 
    ... 
} 

我也有覆盖。是的,所以executeIndexexecuteShow对于“index”和“show”很重要。 ;)