Error: Undefined variable: user
How can I fix this beautifully? I can assign $user to assign some default value, but it probably will not be nice. Maybe there are some other options?
Source: https://ru.stackoverflow.com/questions/833638/
All Articles
ifto do} else { $user = array(); }} else { $user = array(); }- Manitikyl$userstarting value will not be a bad option. - Manitikylreturntoif, then ifAuth::checkgivesTRUE, then everything is fine. BUT if it givesFALSE, then your function will not return anything, becausereturninif, and duplicating 2 times thereturn view...is bad, because duplicate code. - Manitikyl