How to call function from Controller to include into the View page with Codeigniter? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: How to call function from Controller to include into the View page with Codeigniter? (/showthread.php?tid=46340) |
How to call function from Controller to include into the View page with Codeigniter? - El Forum - 10-28-2011 [eluser]Unknown[/eluser] I want to call function from Controller to include into the View page with Codeigniter. Usually when I open any page, I call $this->load->view() in Controller for open that page. Now I want to include sub page into main page, but it can't include any function in View. I try to include function like this. Code: <body><? include(site_url().'/login'); ?></body> I can open page with this link http://localhost/ci_house/index.php/login. but when I open main page for run my code it show these error. Quote: A PHP Error was encountered I want to show 2 view in 1 page . Code: function test1() In views/main.php: Code: $this->load->view('test1'); I want to show like Code: <body> |