Skip to content
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

Merged
merged 10 commits into from
Oct 10, 2011
Merged

User guide tutorial #266

merged 10 commits into from
Oct 10, 2011

Conversation

joelcox
Copy link
Contributor

@joelcox joelcox commented Aug 22, 2011

Cleanly applied patch of the user guide tutorial by Kenny and me, take 3 (4?). Full history can be found here.

@gaker
Copy link
Contributor

gaker commented Aug 22, 2011

This is seriously rad guys. I do have a few comments though.

  • Can you link it in the docs TOC? I also think a tutorial 'overview' page so you can easily find pages would be helpful as well. Or at least linking to the different sections on the user_guide/tutorial/introduction.html page.
  • Please remove the EXT constants from the code examples. This constant was deprecated a couple of months ago, and the only usage is in index.php where it is defined.
  • I think a few of the code examples could be tightened up just a bit, removing extraneous code. e.g.: news_section.html
<?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!!

@bertiful
Copy link
Contributor

Just read through it - great job. One error in user_guide/tutorial/news_section.html on line 178, I believe it should read:

<a href="news/view/<?php echo $news_item['slug']; ?>">View Article</a>

@joelcox
Copy link
Contributor Author

joelcox commented Aug 23, 2011

Thanks @gaker, glad you like it.

  • The tutorial already is in the TOC. I will add links to the other pages in the introduction. The default 'next' and 'previous' links down the page are way too subtle.
  • Good catch.
  • I'll take a look at the code and see what I can do.

@joelcox
Copy link
Contributor Author

joelcox commented Aug 23, 2011

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.

$route['news/(:any)'] = 'news/view/$1';

@bertiful
Copy link
Contributor

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.

@bertiful
Copy link
Contributor

Two small grammar booboos on line 88 of create_news_items.html (ibraries and from), it should read:

... 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>

<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';
Copy link
Contributor

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';

@joelcox
Copy link
Contributor Author

joelcox commented Oct 9, 2011

I just got started with converting the original HTML tutorial to RST.

ericlbarnes added a commit that referenced this pull request Oct 10, 2011
@ericlbarnes ericlbarnes merged commit 77a8c1f into bcit-ci:develop Oct 10, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants