how to call method in controller.