0
在我构建的Symfony Web应用程序中,我所有的HTML页面标题都有一个&符。然而,Symfony的是逃避符号,和我的标题最终看起来像这样:Symfony中的&符号页标题
<title>Home - Wallace &amp;amp; Gromit., Inc.</title>
我的观点YAML定义与转义符号标题:
default:
...
metas:
...
title: Wallace & Gromit., Inc.
而且我已经试过各种在我的layout.php中使用include_title()函数转义策略,但似乎没有任何工作。
<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>
任何想法?
谢谢!这完全让我走上正轨。我最终必须将ESC_RAW传递给include_title()函数和getTitle()函数,并将$ escape设置为false。 – CamelBlues