Added more extensive <?php tags to layout.php

It did not work out of the box for me, now it does