Agile Toolkit View Digest

View and AbstractView will replace tag <?$_name?> with the name of current object. They will also look for all occurrences of “template” tag and pass content of those tags through “locateURL” method of pathfinder.


  ->set('View Demo');
  ->setTitle('Sample Frame');


 $li = $page->add('LoremIpsum')


 ->set('sample text');
//To keep you safe from SQL injection, Text will automatically escape htmlentities.
//To avoid escaping use setHtml() method or you can use "Html" class instead.
//Changing button system-wide:
class Button extends View_Button {}


Re-usable HTML chunk of code:


HTML snippet with enabled logic

What if your HTML code needs some additional logic? It’s then better to create a separate class for your view:

class Alex extends View {
    public $float='right';
    function init(){
    function render(){
        $this ->addStyle('float',$this->float);
    function align($side){
        return $this;

Special page layout

Suppose your designer wants to put something special on one of your application pages. Redefine defaultTemplate() of your page first:

class page_test extends Page {
    function init(){
    function defaultTemplate(){
        return array('page/test');

Put the code designer asked you to use inside templates/default/page/test.html, but don’t forget to add <?$Content?> tag. It’s recommended that you also use the id=”<?$_name?> for the top-most element of template. That’s not mandatory but will enable event binding and reloading.

Leave a Reply

Your email address will not be published. Required fields are marked *