back to basics - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: back to basics (/showthread.php?tid=80541) |
back to basics - richb201 - 11-13-2021 Whenever I try to go to a new function in my controller, index() reruns. In index() I am calling $this->report_generator_amazing() which displays my dashboard. Could this be the reason I can't seem to display anything but the dashboard? I don't think it worked this way when I was using my local apache, but I could be wrong. Besides showing my dashboard, there is a function call in index() that downloads some images from s3. I really only want to do this once. So, can someone tell me, does _init() run every time I go to a new method in my controller? I am just getting confused..... How can I get index not to run EVERY time? RE: back to basics - includebeer - 11-15-2021 Post your controller and your routes' configuration. There's no reason index() would be called for every routes but only the one configured to call index(). RE: back to basics - richb201 - 11-16-2021 (11-15-2021, 03:17 PM)includebeer Wrote: Post your controller and your routes' configuration. There's no reason index() would be called for every routes but only the one configured to call index().and here is config.php: PHP Code: <?php PHP Code: class Configure extends CI_Controller RE: back to basics - includebeer - 11-16-2021 I'm not sure I understand your problem here. The only method in your Configure controller that can be called from a route is index(). What function are you trying to call that calls index() when it should not? Also, the order is a little weird to me. In _configire_output() you load a view, but then there's other things going on after that: generating a report, download images from s3, etc. I think loading the view should be the last thing happening since it's outputting the html document to the browser. RE: back to basics - richb201 - 11-16-2021 "The only method in your Configure controller that can be called from a route is index()." How do you know that? "Also, the order is a little weird to me. In _configure_output() you load a view, but then there's other things going on after that: generating a report, download images from s3, etc. I think loading the view should be the last thing happening since it's outputting the html document to the browser." The images are being downloaded for use later in the application. Generating a report is creating the dashboard with koolreport. It gathers data from some mysql files. The configure_output hasn't been modifed in years. public function _configure_output($output = null) { $GLOBALS['title'] = "Research Credit Online"; $this->load->view('configure.php', (array)$output); } What is configure output normally used for? I am thinking that it is part of the way ci_simplicity works, which I use throughout the application, but not in the dashboard. Here is the dashboard. http://staging.researchstudyonline.com:8181/ Pressing the Enter link changes the URL but the window doesn't change! RE: back to basics - includebeer - 11-17-2021 (11-16-2021, 05:31 AM)richb201 Wrote: "The only method in your Configure controller that can be called from a route is index()." Because that's the only public function in the code you posted. Unless you didn't post it all. We can't debug your code if we don't see it... (11-16-2021, 05:31 AM)richb201 Wrote: What is configure output normally used for? I am thinking that it is part of the way ci_simplicity works, which I use throughout the application, but not in the dashboard. No idea. I think it's just part of your application. I didn't find this function in CI3 or ci_simplicity's repo. |