Welcome Guest, Not a member yet? Register   Sign In
Load view from Controller issue
#6

(This post was last modified: 06-12-2018, 03:13 AM by InsiteFX.)

Your controller is pages/view/$1 because if you look you have no default index method.

So you need to access it like this.

PHP Code:
// wont work
$this->load->view('contact-us'$data);

// should be like this.
$this->load->view('pages/view/contact-us'$data); 

If that wont work you can try this method below.
PHP Code:
// -----------------------------------------------------------------------

if ( ! function_exists('redirectBack'))
{
    
/**
     * redirectBack ()
     * -------------------------------------------------------------------
     *
     * Redirect back to previous page
     *
     */
    
function redirectBack()
    {
        if (isset(
$_SERVER['HTTP_REFERER']))
        {
            
header('Location: '.$_SERVER['HTTP_REFERER']);
        }
        else
        {
            
header('Location: http://'.$_SERVER['SERVER_NAME']);
        }

        exit;
    }


Place it into one of your CodeIgniter helper files.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
RE: Load view from Controller issue - by InsiteFX - 06-12-2018, 03:11 AM
RE: Load view from Controller issue - by InsiteFX - 06-12-2018, 03:32 AM
RE: Load view from Controller issue - by InsiteFX - 06-12-2018, 06:42 AM
RE: Load view from Controller issue - by enelson - 06-12-2018, 09:17 AM
RE: Load view from Controller issue - by InsiteFX - 06-13-2018, 10:55 AM
RE: Load view from Controller issue - by InsiteFX - 06-15-2018, 06:36 AM
RE: Load view from Controller issue - by InsiteFX - 06-15-2018, 08:06 AM
RE: Load view from Controller issue - by InsiteFX - 06-15-2018, 09:33 AM
RE: Load view from Controller issue - by InsiteFX - 06-16-2018, 09:23 AM
RE: Load view from Controller issue - by InsiteFX - 06-22-2018, 10:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB