2010-08-10 56 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」很重要。 ;)