Can phalcon auto bind request parameter to controller?

If I create a controller with attribute, can phalcon auto assign value to these attribute?

<?php

class LoginController extends BaseController
{
    $username;
    $password;

    public function indexAction()
    {
        //Don't use this to get parameter
        //$username=$this->request->getPost('username');
        //$password=$this->request->getPost('password');
    }

}

No, it can't. The code that runs in your function cannot have other code injected into it, so there is no way to have $username defined. $this->username could be defined, but I don't think Phalcon does this. In truth, you wouldn't want to do that anyway, because then $username would become a bit of a magic variable - when you (or someone else) is debugging, it wouldn't be obvious from the code where $username gets initialized. Using $this->request->getPost(&#039;username&#039;) is the best way, because then it's clear where $username got its value.