简体   繁体   中英

Symfony2: Twig detect noscript

I want to render a table which holds all entity data.

There should be a noscript version which additional renders two colomns with editing and deleting operations and a default javascript version where it gets solved dynamicaly over a sidebar.

Is there a way to let this decision to twig? So that twig detects if javascript is supported and if not renders the additional fields?

Regards

Twig-specific code? No

HTML code? Yes

You can make use of the <noscript>...</noscript> tag to display something to browsers without JavaScript support.

Alternatively, you can display the two additional columns to everybody and use JavaScript to hide them. This way, people without JavaScript see them, people with JavaScript don't.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM