|
Using the Pajes HTML Classes Directly
|
|
The underlying Pajes architecture employs a set of
classes to manipulate and generate HTML. It is these
classes that allow the developer the freedom to
programmatically manage the flexible creation of
browser responses.
|
|
These HTML classes are available for use directly by
the developer, with or without the use of the Pajes
templating engine. When employed this way, Pajes
behaves like a number of other HTML class oriented
tools. This approach may be better suited to some
developers or application requirements.
|
|
|
|
|
|
Anyone who has ever needed to restructure a complex
HTML page, particularly one containing nested tables,
will know that it can be a time consuming and
frustrating operation. Even the initial creation can be
laborious.
|
|
Use of HTML classes to build and maintain pages
eliminates much of this effort and results in more
structured code. As an example, consider the creation
of an HTML table.
|
|
The usual approach is to prepare strings containing row
and cell tags with attributes and cell contents
sprinkled throughout and indentation that scrolls off
the developer's page. The process inevitably tends to
involve some trial & error and the addition of a new
column or movement of an embedded table to a new
location involves trawling through matched tag pairs to
perform cut and paste operations.
|
|
In the HTML class approach, you instantiate a table
object via one of a number of constructors. Addition of
rows and columns, or setting of attributes and content
is then achieved through table object methods. The
resultant generated table will never be missing a tag
or contain a misspelling and restructure of the table
is a matter of a change to a constructor, method call
or loop operation. More importantly you have
programmatic facilities to dynamically generate and
manipulate objects such as HTML tables, making the
difficult simpler and the impossible possible.
|
|
|