Happy EngineerLife
"Use models of CakePHP as entities"
It explains how to change (or add) a CakePHP's model a "data object".
He added some functions to App_Model and App_Controller and make possible to write this code.
========================================
class ItemsController extends AppController
{
var $name = 'Items';
function index($id) {
$entity = $this->createEntity('Item', $this->Item->read(null, $id));
$this->set('item', $entity);
}
}
========================================
and then you can write your views in this way.
==============================================
//instead of "echo $item['Item']['price'];"
echo $item->g('price'); (or, echo $item->get('price'))
//You can calculate dynamically with Model values.
echo $item->taxOnPrice();
//You can set a value from View.
echo $item->s('price', 5000);
==============================================