php - Codeigniter Do I need to check if a variable is set in view? -
should checking if variable set in view file ? mean controlling data being sent view, ideally shouldn't necessary.
and if check variable , find it's not set should ? redirect 404 ? again redirecting view doesn't seem right.
what possibilities of view being loaded without particular variable ?
i working in codeigniter.
logic belongs controllers. passing data controllers views.
the best way check in controller, , if it's not exists, redirect then.
views visual representation of data, no logic belongs there.
Comments
Post a Comment