Examples of Simple Views

What we call View in Agile Toolkit, other frameworks may refer to as widgets, helpers and so on. The reason we use the word "View" is because it allows you to view the data on the page.

Some views are really simple, while others rely on complex logic and are interactive. Some views may contain other views in themselves. All views have certain common traits.

Result

Hello world

 

Code

$page->add('HelloWorld');

Although it is not a rule, most views will use a <div> in their HTML output with the "id" attribute equal to the full name of the object. This ID is used if you are calling the js() method to build a jQuery chain for your object

Result

Drag me

 

Code

$page->add('H1')->set('Drag me')
    ->
js(true)->draggable();