可能重复:
Disable CSS stylesheet for a specific action in Symfony
我想从特定模板的响应对象中删除一个样式表。我试图像这样完成它:
我的观点。摘录(摘录):
stylesheets: [main.css, forms.css, jquery-ui-1.8.16.custom.css]
布局(empty.php):
<!DOCTYPE html>
<html>
<head>
<?php include_http_metas() ?>
<?php include_metas() ?>
<?php include_title() ?>
<?php include_stylesheets() ?>
</head>
<body>
<?php echo $sf_content ?>
</body>
</html>
动作(摘录):
$response = $this->getResponse();
$response->removeStylesheet("main.css");
$this->setLayout("empty");
但是,main.css
文件仍包含在生成的html中。我做错了什么?