I am building an application which requires loading view dynamically. The value of view is a variable and it depends on what the controller sets it. Sometimes my value is returned as empty or null value, that is I don’t want any view to load. But then my code breaks at the same place and half of the screen goes blank. Is there any workaround for this?
I am building an application which requires loading view dynamically. The value of view
Share
I found a solution for this myself. What I was doing earlier in my view was:
The value of the viewname used to come from controller as:
What I am doing right now is, in my controller:
And now in my view, I simply write:
Actually this passes view as data in the controller and then parses it in the view where we actually print it.
I hope this helps someone out there. Saved my day atleast…