I am looking for a way to access some variables which I assigned values in one controller(say: controller A) in another controller(say: controller B). One of the controllers contains my main project but the other is where I implemented 'Date Picker'. i 开发者_运维技巧want to move the date from the Date Picker controller to my App controller.
You cannot as the other controller does not/may not live during the execution of the correct controller. Even if it was possible logically one controller have nothing in common - IMHO breaking modularity of MVC pattern.
Refactor code to lib/
, ApplicationController
or some model (separate or divided as method) depending of application.
PS. I'm not quite sure what you mean by "Data Picker" but it sounds like something that should be implemented in model(s).
精彩评论