For the moment, when I'm in a controller and that I want to call a function from another controller, I do this :
App.app.getControllerInstances()['App.controller.OtherController'].do_something();
Is seems a bit heavy to me, is there another (better) way to do this ?
Thanks
var ctrl= new MyController(); ctrl. ControllerContext = ControllerContext; //call action return ctrl. Action();
Show activity on this post. Create new Helper (e.g PermissionHelper. php ) then move the funtion to it and call it where you want using : PermissionHelper::permission();
I would use the getController method: http://docs.sencha.com/touch/2-0/#!/api/Ext.app.Application-method-getController
EG: this.getApplication().getController('ControllerName').doSomething();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With