Hello,
i had this problem month ago with phalcon 2 and my solution was the same as shown(with different models). But now in phalcon 3.0 it seems, that it doesn't work anymore.
Paper.php
public function initialize(){
$this->belongsTo('usersId', __NAMESPACE__ . '\Users', 'id', [
'alias' => 'user'
]);
}
User.php
$this->hasMany('id', __NAMESPACE__ . '\Papers', 'usersId', [
'alias' => 'papers',
'foreignKey' => [
'message' => 'Paper cannot be deleted because he/she has activity in the system'
]
]);
paper/index.volt -> this is working in user/index.volt
{% for p in user.papers %}
{{ p.diverse }}
{% endfor %}
I want in my paper/index.volt different varibales from different models, also in other templates. How can i do this?
Rgds Stefan