【问题标题】:Action "makebook/index" does not exist操作“makebook/index”不存在
【发布时间】:2012-04-25 07:40:36
【问题描述】:

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

./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();
  }
}

我的路由.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))

【问题讨论】:

  • 能否请您附上您的routing.yml 以及makebookActions 所在的目录?
  • 嗨 Manse 感谢您的回复,在这里,我提出了我的 routing.yml.online 服务器项目。请帮助我。有什么问题。
  • 你的actions文件的文件名是什么?
  • 嗨,这是我的动作文件类 makebookActions extends sfActions { public function executeIndex(sfWebRequest $request) { $this->makebooks = Doctrine_Core::getTable('makebook') ->createQuery(' a') ->执行(); }

标签: routing symfony-1.4


【解决方案1】:

我从您的堆栈跟踪 (modules/main/actions/actions.class.php) 推测模块名称是“main”,因此操作文件类应该是 mainActions - 您需要重命名 className 或 moduleName保持一致性

【讨论】:

    猜你喜欢
    • 2019-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多