public function styleAction()
{
$backgroundColor = '#ff0000';
return $this->render(
'AcmeMyBundle::somefile.css.twig',
['backgroundColor' => $backgroundColor],
['Content-Type' => 'text/css']
);
}
public function styleAction(Request $request)
{
$firstColor = 'rgba(130, 30, 30, 0.9)';
$response = $this->render(':css:style.css.twig', [
'firstColor' => $firstColor,
]);
$response->headers->set('Content-Type', 'text/css');
return $response;
}
, , Symfony 3. - , Content-Type 'text/css'.