Welcome Guest, Not a member yet? Register   Sign In
how include VIEW outside the codeigniter?
#2

[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'];
$tmpRequestUri = $_SERVER['REQUEST_URI'];
$_SERVER['PATH_INFO'] = '/outside/view1'; // A custom controller to with method view1 that acually loads the view
$_SERVER['REQUEST_URI'] = '/outside/view1';
require(CI_INDEX); // CI_INDEX is absolute path to CI index
$_SERVER['PATH_INFO'] = $tmpPathInfo;
$_SERVER['REQUEST_URI'] = $tmpRequestUri;

Not tested the code but should work ...


Messages In This Thread
how include VIEW outside the codeigniter? - by El Forum - 01-12-2011, 09:02 AM
how include VIEW outside the codeigniter? - by El Forum - 01-12-2011, 09:32 AM
how include VIEW outside the codeigniter? - by El Forum - 01-12-2011, 12:15 PM
how include VIEW outside the codeigniter? - by El Forum - 01-12-2011, 11:05 PM
how include VIEW outside the codeigniter? - by El Forum - 01-13-2011, 02:49 AM
how include VIEW outside the codeigniter? - by El Forum - 01-13-2011, 06:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB