-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User guide tutorial #266
User guide tutorial #266
Conversation
This is seriously rad guys. I do have a few comments though.
<?php
function get_news($slug = FALSE)
{
if ($slug === FALSE)
{
$query = $this->db->get('news');
return $query->result_array();
}
else
{
$query = $this->db->get_where('news', array('slug' => $slug));
return $query->row_array();
}
} could be: <?php
function get_news($slug = FALSE)
{
if ($slug === FALSE)
{
$query = $this->db->get('news');
return $query->result_array();
}
$query = $this->db->get_where('news', array('slug' => $slug));
return $query->row_array();
} I'm going to push this to feature/tutorial in the main repo, so let's get the other things cleaned up and we'll be good to go. Thank you so much for your hard work in putting this together. It's just fantastic!! |
Just read through it - great job. One error in <a href="news/view/<?php echo $news_item['slug']; ?>">View Article</a> |
Thanks @gaker, glad you like it.
|
Thanks for looking through this @chrisberthe. I agree this is a bit tricky, but we're defining a route for that in the next section down the page.
|
Oops, sorry about that - must have missed it. I saw that you had defined a route for the pages controller and its view method on the static_pages.html but thought you maybe had missed the news route ! Thanks for pointing that out. |
Two small grammar booboos on line 88 of create_news_items.html ( ... like adding a hidden <a href="../libraries/security.html">CSFR prevention field</a>. The latter is used to report errors related to form validation.</p> Also, on line 153 of the same file, shouldn't it read create instead of update? ... This makes sure CodeIgniter sees 'create' as a method instead of a news item's slug.</p> |
…berthe) and added links to the tutorial pages in the introduction.
<p>Let's do that. Open the routing file located at <dfn>application/config/routes.php</dfn> and add the following two lines. Remove all other code that sets any element in the <var>$route</var> array.</p> | ||
|
||
<pre> | ||
$route['default_controller'] = 'pages'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is
$route['default_controller'] = 'pages';
should be
$route['default_controller'] = 'pages/view';
I just got started with converting the original HTML tutorial to RST. |
Cleanly applied patch of the user guide tutorial by Kenny and me, take 3 (4?). Full history can be found here.