Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8578551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:24:59+00:00 2026-06-11T20:24:59+00:00

I have a problem going from page one to page two, three, four, etc…

  • 0

I have a problem going from page one to page two, three, four, etc… when using pagination along with a long and variable query string. I suspect its a routing issue. I’m using a custom query that the user selects with a series of dropdown menus. The resulting url is very long which contains all of the post variables.

For example, the working first page url looks like (with the post variables represented here as letters):

project/web/s/search_results/t/u/v/w/x/y/z  

…and the non-working 2nd page url when page 2 is clicked:

project/web/s/search_results?page=2

The 2nd page is following the routing rule. As mentioned page two doesn’t work as clicked from the pager menu. But if I manually type in:

project/web/s/search_results/t/u/v/w/x/y/z?page=2  

-it does work. The important lines of code are as follows:

Routing rule:

search_results:
  url:      /s/search_results
  param:    { module: s, action: search_results }

url_for helper in pagination:

<?php foreach ($pager->getLinks() as $page): ?>
      <?php if ($page == $pager->getPage()): ?>
        <?php echo $page ?>
      <?php else: ?>
        <a href="<?php echo url_for('@search_results', $object) ?>?page=<?php echo $page ?>"><?php echo $page ?></a>
      <?php endif; ?>
<?php endforeach; ?> 

And the error message:

404 | Not Found | sfError404Exception
Unable to find the s object with the following parameters "array ( 'id' => 'search_results', 'sf_format' => 'html',)").

Should I be using a collection for the routing rule?

Edit:
The object referred to in the url_for helper:

<?php  foreach ($pager->getResults() as $o => $object):  ?>  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T20:25:00+00:00Added an answer on June 11, 2026 at 8:25 pm

    Try:

     <a href="<?php echo url_for(sfContext::getInstance()->getRouting()->getCurrentInternalUri()) ?>?page=<?php echo $page ?>"><?php echo $page ?></a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two forms on one page: a results form and a search form.
I have a problem. I ma moving a system from one server to another
I use GET for pagination, ?page=1 is page one and so on. The problem
I have a very tricky problem going on with content inside a textarea on
if have the following problem: I have a List which i am going through
I have problem with my query on C, I’m using the oci8 driver. This
I have problem with UIWebView delay when the load image from url. In my
I have a problem with python-config --ldflags on OS X 10.6.2. Using my non-system
I have two Drop Down Lists, the second ones are based off which one
Ok this is my problem that no one can seem to answer. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.