public function WebformEntityController::css in Webform 8.5
Same name and namespace in other branches
- 6.x src/Controller/WebformEntityController.php \Drupal\webform\Controller\WebformEntityController::css()
Returns a webform's CSS.
Parameters
\Symfony\Component\HttpFoundation\Request $request: The current request.
\Drupal\webform\WebformInterface $webform: The webform.
Return value
\Symfony\Component\HttpFoundation\Response|\Drupal\Core\Cache\CacheableResponse The response object.
1 string reference to 'WebformEntityController::css'
File
- src/
Controller/ WebformEntityController.php, line 110
Class
- WebformEntityController
- Provides route responses for Webform entity.
Namespace
Drupal\webform\ControllerCode
public function css(Request $request, WebformInterface $webform) {
$assets = $webform
->getAssets();
if ($webform
->access('update')) {
return new WebformUncacheableResponse($assets['css'], 200, [
'Content-Type' => 'text/css',
]);
}
else {
return new CacheableResponse($assets['css'], 200, [
'Content-Type' => 'text/css',
]);
}
}