![]() |
codeigniter 4.5 loading view issue - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: codeigniter 4.5 loading view issue (/showthread.php?tid=90955) |
codeigniter 4.5 loading view issue - xsPurX - 05-27-2024 PHP Code: function test() I get a white screen when I do this. The reason I need this is for keeping my code clean, this is just an example, but I only get a white screen when I access the test method in the browser instead of the test.php view file. If I move the return view into the test function it of course loads. Is this a bug or intended functionality? RE: codeigniter 4.5 loading view issue - kenjis - 05-27-2024 It is a bug in your code, not in a framework. The test() method must return a string (or Response object). Quote:A Controller is simply a class file that handles an HTTP request. URI Routing associates a URI with a controller. It returns a view string or Response object. RE: codeigniter 4.5 loading view issue - ozornick - 05-27-2024 PHP Code: return $this->test2(); ![]() RE: codeigniter 4.5 loading view issue - xsPurX - 05-28-2024 (05-27-2024, 08:16 PM)ozornick Wrote: Ah I see. This app was written in ci2.2 so I guess that changed, Works with the return thanks! ![]() |