开发者

Symfony's Jobeet can't find the index page?

I'm in the day 10 of Symfony's Jobeet Tutorial. Everything worked good, but when I tried to go to the index page: http://localhost:9090/frontend_dev.php

I got the following message:

 sfPatternRout开发者_如何学运维ing 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. 

(I still have a backup of day 9, and the index page works fine).

Any suggestions?


I guess you have replaced the methods in app/modules/job/actions.class.php with what you found on day 10, instead of simply adding them. There must be an executeIndex() method in this file if you want to get something in /job


Yeah, it's something like this:

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)
  {
    ...
  }
  ...
}

I also had overwrite it. Yeah so executeIndex and executeShow are important for "index" and "show". ;)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜