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

[eluser]soup7[/eluser]
i got it working, i can view 'all' news, i can add new articles, but when i click on the 'view article' (to view one news item by itself) i get


404 Page Not Found

The page you requested was not found.


i added the view($slug) to controller (below), and the news 'view' (below also) and updated the routes as directed (also below). any ideas on what may be incorrect? i can view all news but not one by itself...

public function view($slug)
{
$data['news_item'] = $this->news_model->get_news($slug);

if (empty($data['news_item']))
{
show_404();
}

$data['title'] = $data['news_item']['title'];

$this->load->view('templates/header', $data);
$this->load->view('news/view', $data);
$this->load->view('templates/footer');
}

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

<?php
echo '<h2>'.$news_item['title'].'</h2>';
echo $news_item['text'];
?&gt;

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

$route['news/(:any)'] = 'news/view/$1';
$route['news'] = 'news';
$route['(:any)'] = 'pages/view/$1';
$route['default_controller'] = 'pages/view';


Messages In This Thread
news tutorial - by El Forum - 02-23-2013, 01:23 PM
news tutorial - by El Forum - 02-24-2013, 02:14 AM
news tutorial - by El Forum - 02-24-2013, 07:02 AM
news tutorial - by El Forum - 02-24-2013, 07:13 AM
news tutorial - by El Forum - 02-24-2013, 07:17 AM
news tutorial - by El Forum - 02-25-2013, 10:24 AM
news tutorial - by El Forum - 02-25-2013, 12:35 PM
news tutorial - by El Forum - 02-25-2013, 12:42 PM
news tutorial - by El Forum - 02-25-2013, 02:41 PM
news tutorial - by El Forum - 02-26-2013, 12:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB