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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:46:14+00:00 2026-06-01T18:46:14+00:00

I have a Symfony 1.4 and Doctrine 1.2 project running and have a problem

  • 0

I have a Symfony 1.4 and Doctrine 1.2 project running and have a problem with output escaping in one of my DB calls.

The thing is, I am not retrieving a PHP object in my Doctrine query, but rather an array in PHP. The reason why I am doing this is another topic altogether, let’s just say getting a PHP object would not be the solution. Essentially the query is an inner join between two doctrine models. Model 1 inner joins with Model 2 and the results yielded can be accessed like this:

foreach($results as $result)
{
 echo $result['field1']; // accessing results for model 1 
 echo $result['model2']['field1']; // accessing results for model 2 (this inner joins with the model)
}

Now for the above, more specifically for model2, field1 consists of HTML markup, which is naturally output escaped. I need the HTML markup to be rendered as it is! Which is where the problem lies,

if this was a regulation Doctrine object, a simple $modelObject->getRawValue()->getField(); would render HTML markup without escaping it. I am not sure how HTML markup can be rendered in a PHP array?

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-06-01T18:46:16+00:00Added an answer on June 1, 2026 at 6:46 pm

    (Copied from my earlier comment). I wonder, if you print_r($result) inside your loop, you might find it is wrapped in an escaper object. If so, you should be able to use getRawValue() on its elements as well?

    This works because the escaper object implements the Iterator interface (so you can do the foreach over it) and also ArrayAccess (so it appears to work like an array).

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

Sidebar

Related Questions

Problem: I have a symfony project with a database full of production data I
I have a many-to-many relationship defined in my Symfony (using doctrine) project between Orders
I have a project created using Symfony 1.4.15. Because I like Doctrine :) I
On a Symfony exploration project, I have a model using doctrine NestedSet behaviour. Since
Here is the thing, I have implemented the searchable behavior on my symfony project
I have some problem while configuring symfony project on the production server. When I
I'm completely new with Symfony and Doctrine. I have generated a project with a
I have a Symfony2 project with a MySQL db: #app/config/config.yml doctrine: dbal: driver: %database_driver%
I have an application that I'm converting to Symfony/Doctrine. It currently stores a serialized
I'm using Symfony 2 with Doctrine. I have 4 classes: Country, District, County and

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.