![]() |
problem - 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: problem (/showthread.php?tid=64553) |
problem - saumya gupta - 03-03-2016 please clear my doubt: is ($slag=false) ?? public function get_news($slug = FALSE) { if ($slug === FALSE) { $query = $this->db->get('news'); return $query->result_array(); } $query = $this->db->get_where('news', array('slug' => $slug)); return $query->row_array(); } RE: problem - pdthinh - 03-03-2016 (03-03-2016, 10:00 PM)saumya gupta Wrote: please clear my doubt: is ($slag=false) ?? It's default value for $slug if it wasn't specified when the method called. http://php.net/manual/en/functions.arguments.php#functions.arguments.default |