Tigermouse – Core Views Documentation

Distributed under tems of GNU Free Documentation License. Last updated on 21 Jul 2007.


1. Basic


1.1. View

This is base class for all views. It is most generic one and uses simple template to display its sub-views one next to another.


1.2. Label

This view stores and displays text. Can be used where instance of View is required instead of string.


1.3. Index

This is a complete HTML header. Adding sub-views to Index will render them inside <body></body> section. Use $pageTitle static property to set page title.


2. Forms

All views in this section implement IReadableView interface, so you can use valueReader() methods to read theri values respectively.


2.1. Form

This view is a container for other Views. While other IReadableView views return single value via valueReader() method, Form returns array of all sub-views' values. This array is passed to controller as FormContext object.


2.2. Button

Button Form button. Use $text property to set caption.

$button = new Button();
$button->text = 'Click me';

2.3. Input

Input Input field of type text. Set $secret property to change its type password.

$input = new Input();
$input->secret = true;

2.4. TextArea

Text input area.


2.5. Select

Drop down box. Assign assoc array to $options property to define selection. Use $selected property to set default selection.


2.6. RadioGroup

Group of radio buttons. Set $break property to break line after every radio button.

$rg = new RadioGroup();
$radio1 = new RadioButton();
$radio1->value = '1';
$radio1->addText('I accept');
$radio2 = new RadioButton();
$radio2->value = '0';
$radio2->addText('I reject');
$rg->break = true;

3. Containers


3.1. Box, HBox, VBox

Simple containers.


3.2. FieldSet

Set of form fields, as in HTML <fieldset>


3.3. More

More Widget to hide or reveal its inner content.

$more = new More('moreExample');
$more->text = 'Click here for more options';

$label = new Label();
$label->text = 'More options here';

3.4. TabFolder, TabView, Tab

TabFolder Switched tabs view.

$tf = new TabFolder('exampleTabFolder');

$loginTab = new Tab('LoginTab');
$loginTab->action = 'LoginCtrl/getLoginForm';
$loginTab->text = 'Login';

$newAccountTab = new Tab('NewAccountTab');
$newAccountTab->action = 'LoginCtrl/getNewAccountForm';
$newAccountTab->text = 'New account';

3.5. Window

Window Window that can be moved over the screen.

$w = new Window('windowExample');
$w->title = 'New window';

4. Menu


4.1. Menu, MenuItem

Menu Displays hierarchical drop down menu.

$menu = new Menu('ApplicationMenu');

$file = new MenuItem();
$file->text = 'File';

$fileNew = new MenuItem();
$fileNew->text = 'New';

$fileOpen = new MenuItem();
$fileOpen->text = 'Open';

$fileRecent = new MenuItem();
$fileRecent->text = 'Open recent';

$recent1 = new MenuItem();
$recent1->text = 'nothing to open';

$edit = new MenuItem();
$edit->text = 'Edit';

5. Tree


5.1. Tree, TreeItem

Tree Renders tree structure with expandable items.

$tree = new Tree('tree');

$node1 = new TreeNode('element-1');
$node1->text = 'Root node';
$node1->value = 'el1';

$node11 = new TreeNode('element-1-1');
$node11->text = 'Second level element';
$node11->value = 'el1-1';

$node12 = new TreeNode('element-1-2');
$node12->text = 'Advanced FOO technology';
$node12->value = 'el1-2';

6. Table


6.1. Table

Table This is a complicated view. To learn more, take a look at examples provided with Tigermouse.