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

  • SEARCH
  • Home
  • 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 525387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:39:59+00:00 2026-05-13T08:39:59+00:00

I have a Page object whose uniqueness comes from its PageDomain . The schema

  • 0

I have a Page object whose uniqueness comes from its PageDomain. The schema is configured such that the page table contains a page_domain_id field to create the relationship. To show a page, I have an executeShow action and a custom handler. My route looks like this:

page_show:
  url:     /:domain_slug/:slug
  class:   sfPropelRoute
  options:
    model: Page
    type:  object
    method_for_criteria: doSelectByDomain
param:   { module: page, action: show }
requirements:
  sf_method: [get]

By way of an example, I might have /audience/create and also /behavior/create. I need to be able to determine which page is being requested.

The intent of the custom handler (doSelectByDomain) is to factor in the domain_slug and only retrieve/show a page if its domain is also correct. What I’m finding, though, is that even though a domain_slug parameter is available in the action’s $request parameter, I have no way of getting it to my custom handler so that it can be factored into what’s retrieved.

I realize that I can access the sfContext object directly from my model, but that’s inelegant at best and breaks MVC. I’m not afraid to use it if there’s really no better way, but it seems like there must be. Symfony offers a setListCriteria method for list routes, but I can’t find anything similar for object routes.

Help? Thanks.

  • 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-05-13T08:40:00+00:00Added an answer on May 13, 2026 at 8:40 am

    So a little venture through the source code got me where I needed to be. It seems that sfPropelRoute offers the method_for_criteria option, but respects the method option of sfObjectRoute and uses it instead if it exists. If only method_for_criteria exists, then the sfPropelRoute class creates a criteria object from the request parameters.

    Except that it doesn’t include any parameters that aren’t properties of the object. I understand that there’s an argument to be made for that behavior, but in my opinion it’s a mistake.

    Anyway, the short version is that if you use the method option, all parameters are passed (without edit) as an array to the specified handler. If you need request parameters other than those that are properties of the object, this appears to be the way to go.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 275k
  • Answers 275k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Yes. The real question is how much? Areas where they… May 13, 2026 at 2:33 pm
  • Editorial Team
    Editorial Team added an answer Well, in web forms, you would use: Request.UrlReferrer http://msdn.microsoft.com/en-us/library/system.web.httprequest.urlreferrer.aspx So… May 13, 2026 at 2:32 pm
  • Editorial Team
    Editorial Team added an answer A post-commit hook should help you: I'm managing a website… May 13, 2026 at 2:32 pm

Related Questions

I have a DataGridView, and I'm listening to its Scroll event. This gives me
This should be pretty straight forward but I can't seem to get my newbie
I have a multiview on my ASPX page whose ActiveViewIndex I want to set
I'm trying to create a web page that will display an appropriate user control
I currently have a repeater whose datasource is a List where ModelObject is a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.