Welcome Guest, Not a member yet? Register   Sign In
Issue with validation_errors()
#1

[eluser]Unknown[/eluser]
Hi All

I seem to be having an issue retrieving validation messages through the validation_errors() method when the view is nested in a sub folder.

I decided to run some tests and copied basically the same setup as is on the User Guide.

If I put the validation_errors() method in a view that sits in application/views/XXX.php the messages are output fine.

If I have the view in a sub-folder such as application/views/folder/XXX.php the messages are not output (even though the validation rules are being applied and the run() method is returning false).

Any ideas? could this possibly be a bug with the CI core?

Thanks all Smile
#2

[eluser]Kosonome[/eluser]
I guess you need show some code before somebody say something about this.
I usually do that inside a controller:
Code:
if ($this->form_validation->run() == false) {
    $data['validation'] = validation_errors();
    $this->load->view('folder/xxx.php', $data);
}




Theme © iAndrew 2016 - Forum software by © MyBB