How to determine when pretty URLs are in use

I need to format links differently when pretty URLs are in use (change ‘&’ to ‘?’). How can I find out that which one is in use from my view file?

This should help you: UrlManager, yii\web\UrlManager | API Documentation for Yii 2.0 | Yii PHP Framework