Welcome Guest, Not a member yet? Register   Sign In
Form Validation Errors won't echo
#1

[eluser]Unknown[/eluser]
Hello,

I am using Code Igniter's form validation to check the input in some forms. Also, I need some classes of my own. My problem is that the echo of validation errors does not happen at all times.

The echo of validation errors will NOT happen with these lines:

$users = new Users();
echo validation_errors();
$users->someMethodCall();


The echo of validation errors is working with these lines:

<?php echo validation_errors(); ?>
$users = new Users();
$users->someMethodCall();

So, the order seems to matter...
The Users class is located in application/models/include (a folder I created myself).
The Users class declaration is: class Users extends CI_Controller {..}
The Users class constructor only calls the parent constructor.

Now that I am writing this, could the problem be that Users is extending from CI_Controller ? The class creating and using the Users object is extending from CI_Controller itself as well..

Tia




Theme © iAndrew 2016 - Forum software by © MyBB