CodeIgniter Forums

Full Version: Stuck in Tutorial (News_Section)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]faisal6621[/eluser]
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

El Forum

[eluser]jairoh_[/eluser]
in your news contructor maybe you haven't wrote the newcome function or an index function. Smile

El Forum

[eluser]Unknown[/eluser]
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:

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

El Forum

[eluser]faisal6621[/eluser]
@Zhinkk
You are right. The 404 thing is coming from
Code:
if (empty($data['news_item'])){
   show_404();
}

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

El Forum

[eluser]faisal6621[/eluser]
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.