Symfony1 使用RenderPartial():未加载css文件

Symfony1 使用RenderPartial():未加载css文件,symfony1,partial,Symfony1,Partial,我在miembros/actions/actions.class.php上有以下操作: public function executeFoo(sfWebRequest $request){ return $this->renderPartial('foo'); } 在miembros/templates中,我有_foo.php 当我执行它时,我在frontend/config/view.yml中的css文件是 没有加载。我还尝试在_foo.php中使用: 但它也不起作用

我在miembros/actions/actions.class.php上有以下操作:

public function executeFoo(sfWebRequest $request){

     return $this->renderPartial('foo');

}
在miembros/templates中,我有_foo.php

当我执行它时,我在frontend/config/view.yml中的css文件是 没有加载。我还尝试在_foo.php中使用:


但它也不起作用

如果操作为空并且我有一个pruebaSuccess.php文件,则没有问题

有什么想法吗


Javi一个partial没有HTML
标记,symfony将在其中插入CSS文件引用,因此它们不会被添加

如果你想在不使用默认布局的情况下渲染一个动作的结果,考虑使用一个标准模板并将所有的CSS从你需要的文件中分离出来:

apps/frontend/modules/miembros/config/view.yml:

-*
删除syfmony配置级联中的所有其他CSS文件

<?php use_stylesheet('my_css_file.css') ?>
fooSuccess:
  stylesheets: [-*, my_css_file.css]