Dummy - The Framework for Dummies! - The View

The Template engine (View) of the Dummy is basically a copy&paste of my previous engines used in my work framework. It is simple enough that it fits the Dummy approach, while having some very neat characteristics and features.

There are two types of tags within the View: simple tags, like {title}, and content tags that enclose text, like {_title}Content{/title}

You can nest tags any way you want.

The Framework uses some pre-defined tags to automatically fill common data, like {PAGE_TITLE}, {PATH_FILES}, {DOMAIN_NAME}, {_ajaxonly}, {_removeonpopup}, {_removeonajax}, {_removemob} or {_mobonly}

The Template engine will also automatically create some tags on specific parts of the HTML, like {AUTOBODY} (comes after the </body>, useful to add late scripts) and {AUTOHEAD} (comes before </head>, useful to add meta and scripts inside the head).

The most important functions from the View object are ->assign(tag,content), which will assign the output value of a variable (be it simple or content), ->get(tag), which will return the contents of a content tag (might return a View object if the content also have tags, or a string if not), ->append(content,into) to append content in a specific tag, and ->assignFile(tag,file) to assign the contents of a file into a tag.

Furthermore, you can add formatting to a tag using the "|" separator. For instance, {tag|number} will format the content of "tag" as a number, or {tag|truncate|50} will truncate the tag in at most 50 characters.

To see all functions and format definitions, check the full View reference guide.