Update post controller to be compatible with symfony 2.3