![]() |
how include VIEW outside the 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 include VIEW outside the codeigniter? (/showthread.php?tid=37518) |
how include VIEW outside the codeigniter? - El Forum - 01-12-2011 [eluser]Radiart[/eluser] Hi I use Codeingiter 1.7.3 and I attempts integrate it with IP Board 3.1.3 I need to include header and footer from Codeigniter, I use this code in IP Board template: Code: <php> It working but including all main page of website I need include only VIEW global_header.php Do you know how to do it? how include VIEW outside the codeigniter? - El Forum - 01-12-2011 [eluser]Georgi Budinov[/eluser] Interesting task .... On the place where you need to output the view you can do this: Code: $tmpPathInfo = $_SERVER['PATH_INFO']; Not tested the code but should work ... how include VIEW outside the codeigniter? - El Forum - 01-12-2011 [eluser]Radiart[/eluser] Sorry but I don't know how tu use this. When I pute this I have error's. Can U write more how to use this code? how include VIEW outside the codeigniter? - El Forum - 01-12-2011 [eluser]Atharva[/eluser] Assuming your file is on root folder (folder where index.php and system folder resides) Code: define( 'BASEPATH', dirname(__FILE__) ); how include VIEW outside the codeigniter? - El Forum - 01-13-2011 [eluser]Radiart[/eluser] But I know the path. Path is correctly and including working. The problem is that the Codeigniter include whole main page: break/index.php, I need include only break/apllication/view/global_header.php break - folder where is application and system folder I want include only one VIEW not whole page in another application It possible? how include VIEW outside the codeigniter? - El Forum - 01-13-2011 [eluser]Phil Sturgeon[/eluser] A view is a PHP file, you can include a PHP file directly but it will only parse the data that is provided to it. If you want to scrape the HTML from your CodeIgniter site you can use curl or file_get_contents() to grab the entire output and leave a HTML comment in the header to explode on. This sounds weird but is pretty common, I had to do this to integrate MSN's template into the MSN Money UK website a year or two back. Dirty, dirty, madness. |