News article pages 404 |
[eluser]cjobes[/eluser]
Looking back at the tutorial, I found some problems that may be causing the confusion, but I'm still a bit confused in the end. Here are a few things I have found: In the News section of the tutorial you are given the code to create a table in the database you created for the tutorial. You are also asked to create a few "seed" records. In my table I created three records like this: Record 1 Title: New TitleOne Slug: News SlugOne Text: News One Txt Record 2 Title: New TitleTwo Slug: News SlugTwo Text: News Two Txt Record 3 Title: New TitleThree Slug: News SlugThree Text: News Three Txt Later, on the same, page you are given the code to write the News controller. The code for the view looks like this: Code: $data['news'] = $this->news_model->get_news($slug); Further down the page you are told to add to the view method. Here you need to be careful and actually RE-WRITE the method, rather than add to it. That is what I did, which left the first line using the $data key of 'news', while the new set of code changed it and used 'news_item' as the key instead. The instructions say to add the code, so I naturally thought I needed to add the new code to what I wrote before. Right off the bat there is an error that is so minute to find. However, after fixing that minor detail, it still did not fix my problem. I kept noticing that my URL, when trying to view a single news item, was not looking right. The routing code that takes care of this is Code: $route['news/(:any)'] = 'news/view/$1'; Code: /index.php/news/News SlugTwo To test this I created another entry using a one word string, no spaces. Everything then worked fine. I then took the slug value of the records I first created in the table and removed the space from them. Again, it worked fine. So the problem is in the way the segment is being interpreted. The confusion is now about how to get around this, which is not covered at all in the tutorial. C |
Messages In This Thread |
News article pages 404 - by El Forum - 02-26-2013, 10:00 AM
News article pages 404 - by El Forum - 02-26-2013, 12:15 PM
News article pages 404 - by El Forum - 02-26-2013, 01:12 PM
News article pages 404 - by El Forum - 02-26-2013, 03:07 PM
News article pages 404 - by El Forum - 02-26-2013, 04:21 PM
News article pages 404 - by El Forum - 02-27-2013, 12:19 AM
News article pages 404 - by El Forum - 02-27-2013, 03:20 AM
News article pages 404 - by El Forum - 02-27-2013, 03:38 AM
News article pages 404 - by El Forum - 02-27-2013, 03:45 AM
News article pages 404 - by El Forum - 02-27-2013, 02:17 PM
News article pages 404 - by El Forum - 02-27-2013, 02:47 PM
News article pages 404 - by El Forum - 02-27-2013, 03:16 PM
News article pages 404 - by El Forum - 02-27-2013, 04:22 PM
News article pages 404 - by El Forum - 02-27-2013, 06:44 PM
News article pages 404 - by El Forum - 02-28-2013, 01:54 AM
News article pages 404 - by El Forum - 02-28-2013, 02:43 PM
News article pages 404 - by El Forum - 02-28-2013, 04:07 PM
News article pages 404 - by El Forum - 02-28-2013, 06:22 PM
News article pages 404 - by El Forum - 03-14-2013, 04:06 PM
News article pages 404 - by El Forum - 03-14-2013, 05:21 PM
News article pages 404 - by El Forum - 03-15-2013, 07:31 AM
News article pages 404 - by El Forum - 03-15-2013, 09:57 AM
News article pages 404 - by El Forum - 03-15-2013, 10:56 AM
News article pages 404 - by El Forum - 03-15-2013, 12:39 PM
News article pages 404 - by El Forum - 03-15-2013, 10:57 PM
News article pages 404 - by El Forum - 03-16-2013, 02:40 AM
|