cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

[NFR] Support for ViewModels

Open kenjikobe opened this issue 14 years ago • 2 comments

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

kenjikobe avatar Nov 25 '12 20:11 kenjikobe

+1

nikolasha avatar Dec 10 '12 18:12 nikolasha

Keeping the discussion in #476

ghost avatar Apr 10 '13 15:04 ghost