Using RenderPartial(): the css files are not loaded
I have this action bel开发者_开发问答ow at miembros/actions/actions.class.php:
public function executeFoo(sfWebRequest $request){
return $this->renderPartial('foo');
}
and in miembros/templates i have _foo.php
When i execute it, the css files i have at frontend/config/view.yml are not loaded. I have also tried using in _foo.php:
<?php use_stylesheet('my_css_file.css') ?>
but it doesn't work either...
No problem if the action is empty and i have a pruebaSuccess.php file.
Any idea?
Javi
A partial has no HTML <head>
tag into which symfony would insert the CSS file references, so they are not added.
If you want to render the result of an action without using the default layout, consider using a standard template and turning all CSS off apart from the file you need:
apps/frontend/modules/miembros/config/view.yml:
fooSuccess:
stylesheets: [-*, my_css_file.css]
-*
removes all other CSS files in syfmony's configuration cascade.
精彩评论