【发布时间】: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