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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:50:58+00:00 2026-05-25T02:50:58+00:00

On a Symfony web app I’m building, all my HTML page titles have an

  • 0

On a Symfony web app I’m building, all my HTML page titles have an ampersand in them. However, Symfony is escaping the ampersand, and my title ends up looking like this:

  <title>Home - Wallace &amp;amp;amp; Gromit., Inc.</title>

My view YAML defines the title with an unescaped ampersand:

default:
  ...
  metas:
    ...
    title:        Wallace & Gromit., Inc.

And I’ve tried all sorts of escaping strategies with the include_title() function in my layout.php, but nothing seems to work.

<head>
  <?php include_http_metas() ?>
  <?php if (has_slot('title_prefix')): ?>
    <?php $sf_context->getResponse()->setTitle(get_slot('title_prefix') . ' - ' . $sf_context->getResponse()->getTitle(ESC_SPECIALCHARS)) ?>
  <?php endif; ?>
  <?php include_metas() ?>
  <link rel="icon" href="/favicon.ico" type="image/x-icon" />
  <?php include_stylesheets() ?>
  <!--[if IE 7]><link rel="stylesheet" type="text/css" href="css/screen_ie.css" /><![endif]-->
  <?php include_javascripts() ?>
  <?php include_title(ESC_SPECIALCHARS) ?>
</head>

Any ideas?

  • 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-25T02:50:58+00:00Added an answer on May 25, 2026 at 2:50 am

    The setTitle() method has a default parameter for escaping the title. It looks like this:

    setTitle($title, $escape = true)
    

    You shouldn’t be escaping the the call to getTitle() if you are using the default parameter to setTitle(). Try using ESC_RAW instead of ESC_SPECIALCHARS.

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

Sidebar

Related Questions

I am implementing a web app using symfony 2. It has a main page
I have a developed a small web-app in Symfony 2 and Doctrine 2. Can
I'm building a web application with the Symfony Framework. The purpose of this app
I have Symfony 1.4 web-application. Let's say my app is hosted on example.com and
I'm using Doctrine with Symfony in a couple of web app projects. I've optimised
I am looking to distribute a symfony web app, but don't want to reveal
I used symfony 2 and already have created my application. I renamed my app.php
Facts: using standard Symfony 2.0.10 release (includes vendors) all works fine . However with
I'm learning Symfony + Doctrine 1.2 by writing a web app. As the app
I have got a symfony security.yml file # app/config/security.yml security: firewalls: secured_area: pattern: ^/

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.