动作“makebook / index”不存在

时间:2012-04-25 07:40:36

标签: routing symfony-1.4

我有这个错误,但我创建了一个动作类,我认为我的问题是模块生成。 我按照这种方法。用户点击链接自动重定向主页。

./symfony generate:module frontend article

我该如何解决这个问题?

class makebookActions extends sfActions
{
  public function executeIndex(sfWebRequest $request)
  {
    $personalId = $request->getParameter('personal_id', $this->getUser()->getAttribute('detail')->getId());
    $this->personal = Doctrine::getTable('Personal')->find($personalId);

    //if user or his friend viewing makebook showe them all
    if ($this->getUser()->getAttribute('detail')->getId() == $personalId ||
        $this->getUser()->getAttribute('detail')->isFriend($personalId))
    {
      $this->makebook = $this->personal->getmakebook();
    }
    else
    {
      $this->makebook = $this->personal->getmakebook();
    }

    $this->countries = Doctrine::getTable("Country")->findAll();
  }
}

我的routing.yml:

makebook:
  url:  /makebook
  param: { module: makebook, action: index }
most_recent: 
  url:  /makebook/most_recent
  param: { module: makebook, action: mostrecent }
makebook_view: 
  url: /makebook/view
  param: { module: makebook, action: view }
makebook_new:
  url:  /makebook/new
  param: { module: makebook, action: new }
makebook_edit:
  url:  /makebook/edit
  param: { module: makebook, action: edit }

这是我的堆栈跟踪:

#0 /home/whatplan/public_html/apps/frontend/modules/main/actions/actions.class.php(84): sfAction->redirect('@personal_homep...')
#1 /home/whatplan/public_html/cache/frontend/prod/config/config_core_compile.yml.php(459): mainActions->executeSignin(Object(sfWebRequest))
#2 /home/whatplan/public_html/cache/frontend/prod/config/config_core_compile.yml.php(952): sfActions->execute(Object(sfWebRequest))
#3 /home/whatplan/public_html/cache/frontend/prod/config/config_core_compile.yml.php(947): sfExecutionFilter->executeAction(Object(mainActions))
#4 /home/whatplan/public_html/cache/frontend/prod/config/config_core_compile.yml.php(933): sfExecutionFilter->handleAction(Object(sfFilterChain), Object(mainActions))

1 个答案:

答案 0 :(得分:0)

我认为你的stacktrace(modules / main / actions / actions.class.php)模块名称是'main',因此actions文件类应该是mainActions - 你需要重命名className或moduleName引入一致性