How do you comment html templates in Php (in a practical way) ?

Posted by faB on Stack Overflow See other posts from Stack Overflow or by faB
Published on 2009-02-27T16:44:46Z Indexed on 2010/05/15 4:04 UTC
Read the original article Hit count: 391

Filed under:
|
|
|

Is there a simple solution to do the equivalent of Java's comments:

<%-- this is a comment inside a template, it does not appear in the output HTML --%>

Even if you use short php tags, you still have to wrap the comments with comment syntax, on top of the php tags:

<? /* this is a comment of the html template */ ?>

I'm considering doing some kind of filter on the output templates, to remove all html comments, or better yet, custom comments like the Java syntax above, but how would you do that in the most efficient way? You'd have to run a regexp right?

The reason for my question is simply that in a MVC framrwork, using components, and re-usable html templates (think YUI), I need to document clearly those templates, in a readable way..

© Stack Overflow or respective owner

Related posts about php

Related posts about templates