【问题标题】:Symfony's Jobeet can't find the index page?Symfony的Jobeet找不到索引页?
【发布时间】:2010-08-10 19:10:20
【问题描述】:

我在 Symfony 的 Jobeet 教程的 day 10 中。一切都很好,但是当我尝试转到索引页面时:http://localhost:9090/frontend_dev.php

我收到以下消息:

 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 天的备份,索引页工作正常)。

有什么建议吗?

【问题讨论】:

    标签: symfony1 jobeet


    【解决方案1】:

    我猜你已经用你在第 10 天找到的方法替换了 app/modules/job/actions.class.php 中的方法,而不是简单地添加它们。如果你想在 /job 中获取一些东西,这个文件中必须有一个 executeIndex() 方法

    【讨论】:

    • 这就是问题所在。该死的,我刚刚在教程中看到了“简化”这个词,我以为我必须删除所有内容。谢谢!
    【解决方案2】:

    是的,是这样的:

    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”很重要。 ;)

    【讨论】:

      猜你喜欢
      • 2011-09-02
      • 1970-01-01
      • 2015-05-12
      • 2012-04-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-04
      相关资源
      最近更新 更多