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 6809185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:03:20+00:00 2026-05-26T20:03:20+00:00

Please see my question in the template section below: Form (showSuccess): <?php echo form_tag(‘job/salarySubmit’)

  • 0

Please see my question in the template section below:

Form (showSuccess):

<?php echo form_tag('job/salarySubmit') ?>
<input type="hidden" name="job_id" value="<?php echo $job->getId(); ?>">
<input type="submit" value="View Salary">
</form> 

Action:

public function executeSalarySubmit(sfWebRequest $request)
{
    $this->forward404Unless($request->isMethod('post'));
    $param = array('job_id' => $request->getParameter('job_id'), ); 
    $this->redirect('job/salary?'.http_build_query($param)); 
}

public function executeSalary(sfWebRequest $request)
{
    $this->object_id = $request->getParameter('job_id');
    $this->salary = $this->getRoute()->getObject();          
}

Template (salarySuccess.php):

<?php echo $object_id; ?>  // returns correct job_id: 6100, but when I try to access the object's other getters (example: echo $object_id->getName(), I get "Fatal error: Call to a member function getName() on a non-object"
<?php echo $salary->getName(); ?> //works, but it gets the wrong name. It's returning the  first job in my DB with an ID of "1" which is not correct... it needs to be 6100

Routing:

job_salary:
  url:      /job/salary/:job_id
  param:    { module: job, action: salary }
  class:   sfDoctrineRoute
  options: { model: Job, type: object }
  requirements:
    id: \d+
    sf_method: [GET]    
  • 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-26T20:03:20+00:00Added an answer on May 26, 2026 at 8:03 pm

    use var_dump() on your template variables.
    You’ll see that $object_id is not an object (it is a non-object, like the error message says). $object_id is most likely a string or an integer and its value must be “6100”.
    $salary is not the object you’re looking for, because sfDoctrineRoute looks for a parameter called id, and you named it job_id in your routing.yml (which is strange, because you name it id in this route’s requirements.

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

Sidebar

Related Questions

Please see MSO question A long list of possible duplicates — C memory allocation
Please see here for a related question . However, char goes to 0xffff (or
Important : Please see this very much related question: Return multiple values in C++
Please see code below. The destructors are never called. Anyone know why and how
Please see the code below: #include <iostream> #include <stdlib.h> #include <time.h> using namespace std;
everyone. Please see example below. I'd like to supply a string to 'schedule_action' method
I have an Adorner which adornes a Border (please see screenshot below). The MouseDown
I have sql server procedure, please see below. ALTER PROCEDURE [dbo].[uspInsertDelegate] ( @CourseID int,
I am having a string in CSV format. Please see my earlier question Parsing
Please see attached picture to better understand my question i have a matrix of

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.