02-09-2012, 10:50 AM
[eluser]Benair[/eluser]
I'm sure I'll get blasted for this and I'm not going to exhaust the issue beyond this, but with all due respect to those who already know what they are doing here, it didn't help to explain why it isn't working to us who are totally green to MVC and OOP compared to NVP linking and who are trying to baby-step through the early tutorial phase of learning it.
I just went back and re-did the steps provided (and added some notes to the best of my interpretation .
so Add that line shown above to controllers/news.php - I assume under the
(then go to news/views/index.php where the link url is)
AND
(then back in controllers/news because that is where the show 404 is located)
so now in place of my original links that did display (however resulted in all not founds when clicked before)now it returns this plain list of full URLs unlinked.
...mysite.com/code_igniter/index.php/news/slug1
...mysite.com/code_igniter/index.php/news/slug2
...mysite.com/code_igniter/index.php/news/slug3
the list of urls look ok to me... but is that supposed to clue me as to why it isn't linking to results?
In any event I'm moving on from that issue. I appreciate you and anyone taking the time to help others but sometimes it needs to be spelled out a little more for newbe's and assume it doesn't make perfect sense to everyone especially those looking for a "tutorial".
I'm sure I'll get blasted for this and I'm not going to exhaust the issue beyond this, but with all due respect to those who already know what they are doing here, it didn't help to explain why it isn't working to us who are totally green to MVC and OOP compared to NVP linking and who are trying to baby-step through the early tutorial phase of learning it.
I just went back and re-did the steps provided (and added some notes to the best of my interpretation .
Code:
// In News __construct():
$this->load->helper('url');
Code:
$this->load->model('news_model');
(then go to news/views/index.php where the link url is)
Code:
<p><a >View article</a></p>
Code:
<!-- // Replace your link URL with: -->
<?php echo site_url('news/' . $news_item['slug']); ?>
(then back in controllers/news because that is where the show 404 is located)
Code:
if(empty($data['news_item']))
{
//show_404();
exit('The error is here.');
}
so now in place of my original links that did display (however resulted in all not founds when clicked before)now it returns this plain list of full URLs unlinked.
...mysite.com/code_igniter/index.php/news/slug1
...mysite.com/code_igniter/index.php/news/slug2
...mysite.com/code_igniter/index.php/news/slug3
the list of urls look ok to me... but is that supposed to clue me as to why it isn't linking to results?
In any event I'm moving on from that issue. I appreciate you and anyone taking the time to help others but sometimes it needs to be spelled out a little more for newbe's and assume it doesn't make perfect sense to everyone especially those looking for a "tutorial".