I have one doubt, I know the (Symfony2) controller's function and so I think is not correct to declare variables inside of these classes. But is possible?
In this way I could have one variable in all methods keeping its state.
Thanks.
Yes, it is possible and correct.