listErrors() always displays error - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: listErrors() always displays error (/showthread.php?tid=75759) |
listErrors() always displays error - muuucho - 03-13-2020 I am trying to validate the news form from the docs tutorial and display errors in my view. However, I always get all the errors. My Controller: Code: public function create() Code: h2><?= esc($title); ?></h2>
RE: listErrors() always displays error - muuucho - 04-13-2020 Lonnie uses a nice way of displaying errors in his Myth/Auth. It is implemented in the login form. RE: listErrors() always displays error - InsiteFX - 04-14-2020 There are two ways of getting form errors. PHP Code: // All Errors Lonnie uses this in his views. PHP Code: <?= view('Myth\Auth\Views\_message_block') ?> This is his message_block code for the included view. PHP Code: <?php if (session()->has('message')) : ?> Look at the Myth/Auth Controller to see how he is doing the Errors. RE: listErrors() always displays error - muuucho - 04-14-2020 Indeed, but I have been looking for a way to display errors tied to its input field. I just wanted to say that my problem is solved, and the solution is to be found in Myth/auth: Controller: PHP Code: $rules = [ PHP Code: <div class="form-group"> |