You can also check that from server side and pass a flag variable (which contains either true or false) to twig file and based on that include the css.
– Yash ParekhApr 16 '18 at 07:29
Is there any way to directly implement it in twig file rather than write code in controller?
– RadhikaApr 16 '18 at 07:37
i think there is not any way to do this.you need to write code in controller
– RahulApr 16 '18 at 07:44
You could add a new `Twig_Simple_Function` if you are able to locate the `twig` instance. `$twig->addFilter(new \Twig_Simple_Function', 'file_exists', 'file_exists'));`
– DarkBeeApr 16 '18 at 08:21