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

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -