CodeIgniter Forums
Tutorial for CI 3 - news section - bug found - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19)
+--- Thread: Tutorial for CI 3 - news section - bug found (/showthread.php?tid=62644)



Tutorial for CI 3 - news section - bug found - pbi - 08-09-2015

In the tutorial at creation of application/views/news/index.php (on http://www.codeigniter.com/user_guide/tutorial/news_section.html) is a detail missing.
The line
<p><a href="<?php echo $news_item['slug'] ?>">View article</a></p>
does not work, because the created link is only the slug, but it must be news/slug. The following change corrects the issue (and was also part of the documentation for CI 2).
<p><a href="news/<?php echo $news_item['slug'] ?>">View article</a></p>

Can anyone confirm this?

Thanks

PBI


RE: Tutorial for CI 3 - news section - bug found - Narf - 08-10-2015

There's a routes section at the end of that page and you need to complete it.


RE: Tutorial for CI 3 - news section - bug found - pbi - 08-10-2015

you're right.
Thanks


RE: Tutorial for CI 3 - news section - bug found - Carpintonto - 08-20-2015

A separate issue in the same section -

Seems the documentation/tutorial is just a bit behind  the code version 3

Where the sql example
Code:
CREATE TABLE news (
       id int(11) NOT NULL AUTO_INCREMENT,
       title varchar(128) NOT NULL,
       slug varchar(128) NOT NULL,
       text text NOT NULL,
       PRIMARY KEY (id),
       KEY slug (slug)
);

the example News_model.php will actually look for table CodeIgniternews because application/config/database.php now has

Quote:'dbprefix' => 'CodeIgniter',   //line # 72

instead of an empty string for dbprefix.

For my first run through, I am modifying the code to work with the tutorial.


RE: Tutorial for CI 3 - news section - bug found - Narf - 08-20-2015

(08-20-2015, 01:13 PM)Carpintonto Wrote: A separate issue in the same section -

Seems the documentation/tutorial is just a bit behind  the code version 3

Where the sql example

Code:
CREATE TABLE news (
       id int(11) NOT NULL AUTO_INCREMENT,
       title varchar(128) NOT NULL,
       slug varchar(128) NOT NULL,
       text text NOT NULL,
       PRIMARY KEY (id),
       KEY slug (slug)
);

the example News_model.php will actually look for table CodeIgniternews because application/config/database.php now has


Quote:'dbprefix' => 'CodeIgniter',   //line # 72

instead of an empty string for dbprefix.

For my first run through, I am modifying the code to work with the tutorial.

That prefix is never suggested by the tutorial.