-
Notifications
You must be signed in to change notification settings - Fork 1
UI.View
moellep edited this page Nov 13, 2014
·
5 revisions
We think TT2's style of templating is inside out. (Same goes for many templating languages: Cold Fusion, ASP, JSP, Velocity, PHP, ...)
Instead of this:
<html>
<head>
<title>[% title %]</title>
</head>
<body>
<h1>Some Interesting Links</h1>
<table>
[% FOREACH link IN link_list %]
<tr><td><a href="[% link.url %]">[% link.title %]</a></td></tr>
[% END %]
</table>
</body>
We would write something more like this:
Page({
head => Title(['title']),
body => Join([
H1('Some Interesting Links'),
Table(LinkList => [
Link(['title'], ['url']),
]);
]),
});
We encapsulate all the html inside a UI.Widget. In this example: Page, Join, H1, Table, and Link.
It's the Widget's responsibility to manage HTML and URI encoding, CVS quoting, ensuring well-formed XML, or correct PDF incantations.
- View.Search
- View.ThreePartPage -- a common base class
- View.SiteAdmin
- Agenda
- Getting Started
- My-Status Example Application
- Model
- View
- Task
- Application Support
- Testing
- Miscellaneous