Welcome Guest, Not a member yet? Register   Sign In
Files needed to use get_instance() when its not available or sure way for custom 404's
#1

[eluser]CroNiX[/eluser]
Basically Im working on the elusive custom 404 problem. Ive tried many solutions found on the site and am banging my head. They either don't work like a true 404 should or require extensive modifications and custom routes. If someone has a really good (and easy to implement) custom 404 solution Id like to know. The requirement is it should be a true 404 (not using a redirect and have the (bad) url intact) and be able to use anything normally available to CI (views/db/etc).

If that isnt possible, what are the required files needed to use get_instance()?

So in my error_404 I can:
Code:
<?php
if(! function_exists('get_instance'))
{
    //include files needed
    include_once(???);
    include_once(???);
}
$CI =& get_instance();
//do some logic...

//show my view
header("HTTP/1.1 404 Not Found");
CI->global->make_page_error('404 Page Not Found', '<span class="error">' . $message . '</span>');




Theme © iAndrew 2016 - Forum software by © MyBB