Skip to content

Commit

Permalink
Merge pull request #1442 from samsonasik/remove-form-usage
Browse files Browse the repository at this point in the history
remove form view in application/View/ and form helper usage in create new items tutorial
  • Loading branch information
jim-parry authored Nov 9, 2018
2 parents 07977c2 + e8ee420 commit 818808c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
9 changes: 0 additions & 9 deletions application/Views/form.php

This file was deleted.

10 changes: 2 additions & 8 deletions user_guide_src/source/tutorial/create_news_items.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ the slug from our title in the model. Create the new view at

<?= \Config\Services::validation()->listErrors(); ?>

<?= form_open('news/create'); ?>
<form>

<label for="title">Title</label>
<input type="input" name="title" /><br />
Expand All @@ -34,13 +34,7 @@ the slug from our title in the model. Create the new view at

</form>

There are only two things here that probably look unfamiliar to you: the
``form_open()`` function and the ``\Config\Services::validation()->listErrors()`` function.

The first function is provided by the :doc:`form
helper <../helpers/form_helper>` and renders the form element and
adds extra functionality, like adding a hidden :doc:`CSRF prevention
field <../libraries/security>`. The latter is used to report
There is only one thing here that probably look unfamiliar to you: the ``\Config\Services::validation()->listErrors()`` function. It is used to report
errors related to form validation.

Go back to your news controller. You're going to do two things here,
Expand Down

0 comments on commit 818808c

Please sign in to comment.