Closed danmatthews closed 12 years ago
You have an underscore in your classname.
According to the cascading filesystem, this class should be in app/classes/login/validation.php. Now FuelPHP can't find the class, hence the error.
Ah, ok, thanks. Is there any more documentation on the cascading file system and where this applies when loading classes? I apologise if this is an RTFM situation, but when following the example from the validation documentation, it can be very confusing.
Using the methods suggested in Validation - Classes, i created a new file and class at
fuel/app/classes/login_validation.php
, with the following (test) code:Then, to use it with a validation sequence in a controller i used:
But i get an exception:
InvalidArgumentException [ Error ]: Input for add_callable is not a valid object or class.
I thought this may be a problem with my class syntax, or naming, but when i manually include the class into the controller using:
require_once('../fuel/app/classes/login_validation.php');
Everything works as expected.
Currently working on 1.1/master.