A Little Trick for Dealing with Lots of View Files

WARNING: This article features ANCIENT code! I'm keeping it online because it's interesting to see what I was thinking 10+ years ago. But you DEFINITELY should not be using this code. Anything you're reading about on this page has changed significantly since this was written.

I've been messing around with the Kohana Framework a lot lately. The simplicity of using the View Factory has led me to have a ton of little view snippets and it gets tricky remembering where they all live. So I started adding this line to the top of all my views:

<?php if(Kohana::$environment !== 'production'): echo('<!-- '.__FILE__.' -->'); endif; ?>

When there's a problem, I can hit "view-source" and instantly locate the offending file. Not exactly some brilliant revolution, but it does come in handy.

Three more thoughts: