Welcome Guest, Not a member yet? Register   Sign In
CI newbie and "news" tutorial
#1

[eluser]CMG Dev[/eluser]
I'm new to CodeIgniter so I have decided to follow user guide first and actually I'm stuck on http://ellislab.com/codeigniter/user-gui...ction.html :\

I'm able to display "news" but when I click to see particular news by slug I'm getting 404 error. Links to slug part looks like /index.php/news/test-X and routes are:

Code:
$route['news/create'] = 'news/create';
$route['news/view/(:any)'] = 'news/view/$1';
$route['news'] = 'news';
$route['(:any)'] = 'pages/view/$1';
$route['default_controller'] = 'pages/view';

Also I have tried to switch in the /views/news/index.php

Code:
<p><a href="news/&lt;?php echo $news_item['slug'] ?&gt;">View article</a></p>

to

Code:
<a href="&lt;?php echo base_url('news/' . $news_item['slug']);?&gt;">View article</a>

but in that case I'm not getting any news listings.

Any clue?

Thanks
#2

[eluser]CMG Dev[/eluser]
OK. I was able to resolve issue based on that thread: http://ellislab.com/forums/viewthread/209349/

IMO Tutorial should be fixed to avoid questions like mine Wink




Theme © iAndrew 2016 - Forum software by © MyBB