How to set active class to the menu of any page coming from a single.php template

Update: Here is the answer:

<?php if(is_single()) echo 'active'; ?>