Error in User Guide |
[eluser]Unknown[/eluser]
Hi everyone, I've been learning how to use codeigniter, and I think it's great! I'm not sure where to post this, and I just wanted to post a quick error that I think I might have found in the user guide: http://ellislab.com/codeigniter/user-gui...ction.html Under the "display the news", the code for application/views/news/index.php the code it says is: Code: <?php foreach ($news as $news_item): ?> Code: <?php foreach ($news as $news_item): ?> Please let me know if I've posted in the wrong place or I'm speaking nonsense. Best, DG Kim
[eluser]Eduard Stankovic[/eluser]
Yes, there is mistake, but your solution doesn't fix that. your solution just link to method not to controller it should be like that : Code: site_url("news/view/".$news_item['slug']); sorry for my english
[eluser]Unknown[/eluser]
Hi, thanks for the response. I tried my solution and it worked just fine, it just added the method and the slug after the news. I think this is because I didn't add a / in front of the view in the link tags.
[eluser]Aken[/eluser]
It's because the user guide suggests using a relative URL. It may cause "problems" for new users, but it's a very common issue with making websites and it should be understood how it works. It's also the best option to keep the tutorial as simple and universal as possible. A slash at the start of the link wouldn't work if someone had CodeIgniter installed in a subdirectory. Using site_url() is a good option, but then you have to introduce helpers and everything in the tutorial also. |
Welcome Guest, Not a member yet? Register Sign In |