Good ways of planning HTML
Posted: Mon Jul 18, 2005 8:13 am
Lately, I abandoned work on a gallery since the HTML was hard coded in to most of the program. This had the problem of making a mess which was difficult to follow, and HTML which was frequently out of alignment. Recently I have started work on a new gallery with a new HTML writer ans I was wondering if anyone could say whether the following setup is a good idea:
writer.php (class writer), this deals with the nitty-gritty of putting text and tags onscreen. It has a constructer to set an indent counter, basic output functions for raw text (no tags), opening tags, closing tags and one for empty type tags (<br/> etc)
HTMLinterpreter.php (class HTMLinterpreter), this creates an instance of writer and in its constructor. Its methods deal with text output, and ones for opening and closing all types of tags.
builder.php (class builder), creates an HTMLinterpreter in its constructor and has functions such as createTitle($text,$level) which makes calls to several functions on HTMLinterpreter.
The idea I had with it is to make the classes become pregressivly more high level until it reaches builder, which does not have the user say what HTML they want, but what they want doing.
Any thoughts?
writer.php (class writer), this deals with the nitty-gritty of putting text and tags onscreen. It has a constructer to set an indent counter, basic output functions for raw text (no tags), opening tags, closing tags and one for empty type tags (<br/> etc)
HTMLinterpreter.php (class HTMLinterpreter), this creates an instance of writer and in its constructor. Its methods deal with text output, and ones for opening and closing all types of tags.
builder.php (class builder), creates an HTMLinterpreter in its constructor and has functions such as createTitle($text,$level) which makes calls to several functions on HTMLinterpreter.
The idea I had with it is to make the classes become pregressivly more high level until it reaches builder, which does not have the user say what HTML they want, but what they want doing.
Any thoughts?