We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Print variable to view not using Volt

Hello, I'm beginning with Phalcon and I don't know how to set a variable in the controller so I it can be printed in the view. I'm not using volt.

I'm using this code in the controller:

$this->view->UsrUsername = $user->UsrUsername;

but I don't know how to printed. Thanks.



5.0k
Accepted
answer

in view: <?php echo $UsrUsername ?>



18.9k

Thanks :D