![]() |
Undefined variable: content - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Undefined variable: content (/showthread.php?tid=64897) |
Undefined variable: content - davy_yg - 04-09-2016 Hello, I am trying to troubleshoot this: A PHP Error was encountered Severity: Notice Message: Undefined variable: content Filename: cms/index.php Line Number: 101 Backtrace: File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\innovationci3\application\views\cms\index.php Line: 101 Function: _error_handler ------------------------------------ controllers\Site.php PHP Code: // CONTENT // Model_pages.php PHP Code: function content($id_content=""){ Any clue why the error appears? RE: Undefined variable: content - Tpojka - 04-09-2016 Is "$this->id_content" assigned in model '__construct()' or initialized at the beginning of model class? Second thing is to debug controller and at the beginning of the controller (after model loading) put 'var_dump($this->model_pages->content());exit;' RE: Undefined variable: content - pb.sajjad - 04-09-2016 (04-09-2016, 01:15 AM)davy_yg Wrote: Hello, You do not return anything in content function in Model!!! |