Reputation: 886
I do plan on using an application, but I also want to be able to use standalone view and controller groupings. The only way I have found to use a controller is by listing it in the "controllers" config of an app. Is this the only way?
Upvotes: 0
Views: 77
Reputation: 995
A Controller does not have to be listed in an app's controllers
config for it to work. You can use getController (also available on the global application) to create an instance of any controller. If you create the controller in some other way (using new, for example) you will be responsible for initializing it and making sure it has a reference to the global application. If it doesn't have a reference to the application, the controller methods that delegate to the application won't work.
Upvotes: 2