why am i getting: Call to undefined method sfPHPView::getRequestParameter?
i have this code in listmatchesSuccess.php:
$matching_rows = RcProfileTablePeer::getAllBySelection($gender_id1,$gender_id2,$age1,$age2,$province_id);
$pager = new sfPropelPager('RcProfileTable', 10);
$pager->setCriteria($matching_rows);
$pager->setPage($this->getRequestParameter('page', 1));
$pager->init();
in my actions.class.php i have just the function:
public function executeListmatches(sfWebRequest $request)
{
}
i just want to list all the rows that matches my search criteria which i select on the main page, i hit a go button then get to listmatches page
the submit button 开发者_StackOverflowcall in _login.php is:
<form action="<?php echo url_for('password/listmatches?page='."1" ) ?>" method="post" >
is it because i do not have those pager rows in my actions.class? please help? thank you
Why did you put the pager code in your view (listmatchesSuccess.php)? It belongs in the action. I strongly recommend doing the Practical Symfony tutorial to understand the MVC model:
Jobeet Tutorial
The $this->getRequestParameter() is a method from sfAction class so you cannot use it in the view, which is descended from the sfView class. Again - your pager code belongs in actions.class.php.
Here is a tutorial about paging in symfony. It is made for the 1.2 version but it will do just fine.
Pagination tutorial
精彩评论