Welcome Guest, Not a member yet? Register   Sign In
Direct echo in Controller - bad parctice?
#4

CI's views are captured with output buffering and sent to the browser after the controller/method is totally done being processed. Echoing from controllers will bypass that and send data FIRST, followed by any views being shown. All output, except general debugging while in development of course, should be sent through a view, not echoing from a controller.

Really the only exception to that is sending back json or other data. Then you'd echo it from the controller and not use a view (in most cases)
Reply


Messages In This Thread
RE: Direct echo in Controller - bad parctice? - by CroNiX - 04-01-2015, 06:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB