Controllers

Controllers

rendering only text from controlller:

    if($this->Request->isAjax()){
           $this->renderText($this->t('Responding text to ajax'));
    }

rendering any action without layout:

  $this->renderAction('edit',null,false);

Views

you can access most of controllers properties directly without the need of a “$this→” reference

in controller:
    $this->menu = 'Main';

accessing it in tpl:
    <?= $menu ?>

You should also note that $this→params is also transfered to the view like this:

in controller:
    $this->params['id'] = 3;
    $this->params['type'] = 3;

accessing it in tpl:
    <?= $id ?>
    <?= $type ?>
 
controller-view-interaction.txt · Last modified: 2010/04/19 10:38 by 130.92.9.58
 

The Akelos Framework was created by Bermi Ferrer and other contributors.
Potions of the code and documentation have been ported from Ruby on Rails.

The Akelos Framework is released under the LGPL license.

"Akelos", "Akelos Framework", and the Akelos logo are trademarks of Bermi Labs All rights reserved.

Wiki driven by DokuWiki