Welcome Guest, Not a member yet? Register   Sign In
help
#1

[eluser]flash_lover[/eluser]
Has anyone tried this tutorial
http://codeigniter.com/wiki/MVC/

I keep getting 404 error.

//function Welcome() (php4, php5 below) function __construct() { parent::Controller(); $this->load->helper('url'); } function index() { $this->load->model('links'); $links['links'] = $this->links->get_links(); $data = array( 'title' => 'Test Application', 'current_page' => 'Welcome', 'navigation' => $this->load->view('navigation/nav_main','',true), 'content' => $this->load->view('content/link_list',$links,true) ); $this->load->view('layout/main',$data); }

Any ideals

Thanks
#2

[eluser]InsiteFX[/eluser]
You will not get much help displaying your code like that!

Use POST REPLY and code tags not FAST REPLY.

InsiteFX
#3

[eluser]Mischievous[/eluser]
Code:
function __construct()
{
    parent::Controller();
    $this->load->helper('url');
}
function index()
{
    $this->load->model('links');
    $links['links'] = $this->links->get_links();
    $data = array(
        'title' => 'Test Application',
        'current_page' => 'Welcome',
        'navigation' => $this->load->view('navigation/nav_main','',true),
                'content' => $this->load->view('content/link_list',$links,true)
    );
    $this->load->view('layout/main',$data);
}
This code looks fine to me at first glance... what is the URI when trying to access this?
#4

[eluser]InsiteFX[/eluser]
Code:
Change this:
$links['links'] = $this->links->get_links();
    $data = array(
        'title' => 'Test Application',
        'current_page' => 'Welcome',
        'navigation' => $this->load->view('navigation/nav_main','',true),
                'content' => $this->load->view('content/link_list',$links,true)
    );

// To this aand try it
$links = array();
$data = array();

$links['links'] = $this->links->get_links();

$data['title'] = 'Test Application';
$data['current_page'] = 'Welcome';
$data['navigation'] = $this->load->view('navigation/nav_main','',true);
$data['content'] = $this->load->view('content/link_list',$links,true);

$this->load->vars($data);
$this->load->view('layout/main');

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB