phalcon volt engine with getters and setters

I want try this framework, but i have a problem. i am create a application via phalcon-dev-tools

phalcon project phalcon after this i create table users with 2 field = id, login

then

phalcon scaffold --table-name=users --get-set --force --template-engine=volt Model with protected attribute with public methods - its okey

in volt {{ user.id }} return null, because its try to ger property id not method getId()

why?

ps. phalcon 1.2.1

Are you setting the user object in your view?

// In controller
$this->view->setVar('user', User);


523

yes,

$this->view->setVar('page', $paginator->getPaginate());

it is default controller and template generated from devtools



23

I have a same problem. Table 'topics' has fields 'id' and 'text'.

My model is:

class Topics extends \Phalcon\Mvc\Model
{
    protected $id;
    protected $text;
    //...
    public function getId()
    {
        return $this->id;
    }

    public function getText()
    {
        return $this->text;
    }
    //...

in controller I wrote:

    $this->view->first_topic = Topics::findFirst();

and in volt template: ```php 1: {{ firsttopic.text }} <br> 2: <?php echo $firsttopic->text; ?> <br> 3: {{ firsttopic.getText() }} <br> 4: <?php echo $firsttopic->getText(); ?> <br> ``` as result I have ```php 1: 2: 3: First topic 4: First topic ```

P.S. I'm using version 1.2.3. from github and php 5.4.9