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

doc fix: replace validation_errors() function with \Config\Services::validation()->listErrors() #1238

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions user_guide_src/source/tutorial/create_news_items.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ you haven't written any information to the database yet. In this section
you'll expand your news controller and model created earlier to include
this functionality.

.. note:: This section of the tutorial cannot be completed as certain
portions of the framework, like the form helper and the validation
library have not been completed yet.

Create a form
-------------

Expand All @@ -24,7 +20,7 @@ the slug from our title in the model. Create the new view at

<h2><?= esc($title); ?></h2>

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

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

Expand All @@ -39,7 +35,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 ``validation_errors()`` function.
``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
Expand Down