• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stuck in Tutorial (News_Section)

I'm newbie to CodeIgniter and following the tutorials trail.
I'm stuck on NewSection tutorial where I'm unable to view the detailed news.

I'd attached the screen shots below

in your news contructor maybe you haven't wrote the newcome function or an index function. Smile

I just finished the introduction today! I know this is kind of obvious, but make sure you enter the correct slug in the url. If you want to go to the News Title 1 article make sure you enter the correct slug in your table for that article in the url after index.php/news/. For example, look at my setup (attached the file below). If I want to go to the Test Article I would enter index.php/news/test-article (since that is the slug I set in my table).

I think it is 404'ing because the it did not retrieve the correct article based on the slug and the $data['news_item'] is empty:

if (empty($data['news_item'])){

You are right. The 404 thing is coming from
if (empty($data['news_item'])){

But I'm not getting why $data['news_item'] is empty? I'd created the slug as you mentioned. Still the same problem.

The problem is now solved as by mistaken I'd written $data['news'] instead of $data['news_item'].

But I would like to know how to remove the index.php from the URL.

I'd created an .htaccess file as mentioned at CodeIgniter URLs. But still I've to add index.php in my url on localhost.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.