cphalcon
cphalcon copied to clipboard
[NFR] Support for ViewModels
It would be fine if phalcon supports ViewModels, this is an object between the controller and the views, it reads any data required by the views, the public properties are automatically converted to view variables:
<?php
class View_Test
{
public $hello = 'world';
public function testing()
{
return 'foobar';
}
}
this helps to add a clear separation between the views and the controllers reusing the code, usually methods that make queries to the database
+1
Keeping the discussion in #476