Skip to content

Commit

Permalink
docs: use validation_list_errors() in user guide
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Aug 18, 2022
1 parent 8c78b26 commit 4157c47
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions user_guide_src/source/libraries/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ code and save it to your **app/Views/** folder::
</head>
<body>

<?= $validation->listErrors() ?>
<?= validation_list_errors() ?>

<?= form_open('form') ?>

Expand Down Expand Up @@ -166,7 +166,7 @@ The form (**signup.php**) is a standard web form with a couple of exceptions:
#. At the top of the form you'll notice the following function call:
::

<?= $validation->listErrors() ?>
<?= validation_list_errors() ?>

This function will return any error messages sent back by the
validator. If there are no messages it returns an empty string.
Expand Down
8 changes: 2 additions & 6 deletions user_guide_src/source/libraries/validation/001.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@ class Form extends BaseController
public function index()
{
if (strtolower($this->request->getMethod()) !== 'post') {
return view('signup', [
'validation' => Services::validation(),
]);
return view('signup');
}

$rules = [];

if (! $this->validate($rules)) {
return view('signup', [
'validation' => $this->validator,
]);
return view('signup');
}

return view('success');
Expand Down

0 comments on commit 4157c47

Please sign in to comment.