Skip to content

Commit

Permalink
Updated final tutorial page. Fixes #1292
Browse files Browse the repository at this point in the history
  • Loading branch information
lonnieezell committed Oct 5, 2018
1 parent 133bcd6 commit b4d1264
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions user_guide_src/source/tutorial/create_news_items.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ validation <../libraries/validation>` library to do this.
helper('form');
$model = new NewsModel();

if (! $this->validate($this->request, [
'title' => 'required|min[3]|max[255]',
if (! $this->validate([
'title' => 'required|min_length[3]|max_length[255]',
'text' => 'required'
]))
{
Expand Down Expand Up @@ -139,10 +139,10 @@ as a method instead of a news item's slug.

::

$routes->post('news/create', 'News::create');
$routes->add('news/(:segment)', 'News::view/$1');
$routes->match(['get', 'post'], 'news/create', 'News::create');
$routes->get('news/(:segment)', 'News::view/$1');
$routes->get('news', 'News::index');
$routes->add('(:any)', 'Pages::view/$1');
$routes->get('(:any)', 'Pages::view/$1');

Now point your browser to your local development environment where you
installed CodeIgniter and add index.php/news/create to the URL.
Expand Down

0 comments on commit b4d1264

Please sign in to comment.