I’m using the Codeigniter framework and have tried to stick with the MVC philosophy as best I can. I’ve recently run into an issue that I’m not entirely sure how to handle.
I have a PHP script running that takes a fairly long time (creating an index for my search engine). What I want to do is have the html show up as it’s running.
If I just put echo statements into my controller, and echo every time a document is indexed, it does what I want. I can watch the progress as it happens.
But that doesn’t correspond with an MVC philosophy, and I also don’t get any of the nice styles and html formatting that is set up for my view classes.
The only way I know to interact with my view is to run the code in the controller, and store the log info into a variable, then pass it to the view when I’m done. But that means I just sit waiting for ages, and finally a big log display shows up (nicely formatted, mind you).
Does anyone know how to do what it is I’m trying to achieve? Use a View, but before the Controller is “done” yet?
You can load multiple view’s in a controller, how about loading and displaying a view first and then doing more processing.
There is even the possibility of loading a page (like an outside frame or something) and then using JQuery to load the content that is taking a long time to load.