Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我通过在似乎不使用别名的应用程序实例上调用 getController 来获得所有控制器的实例。但是我发现了在一些没有设置别名的地方设置了别名的例子。
那么是否建议为我的控制器定义一个别名,或者我可以/应该保留这个属性吗?
好吧,你应该能够自己回答这个问题......
根据 ExtJS 中 MVC 项目的结构和调用控制器的方式,您永远不需要别名,并且该getController()方法不使用别名。所以你可以省去这些行。
getController()
但是,如果您喜欢它,您可以定义一个,我认为在您不需要它的情况下,我认为没有任何可以针对赞成和反对给出的建议。