I have the following files:
- views/register.phtml view for a registration page
- forms/RegisterForm.php for the registration form on the registration page
- controllers/SessionController.php with a RegisterAction()
- models/Users.php model for database interaction.
The Users.php model contains a Uniqueness Validator for username and email, so users can't add duplicate records. Everything is working perfectly fine, the form is displayed correctly, labels are displayed, when someone submits the registration form, the record gets added to the database, however, when i try to add a record that already exists, it gives me "Fatal error: Call to a member function getLabel() on a non-object in C:\wamp\www\test.local\app\views\session\register.phtml on line 11" instead of getting an error message from the Uniqueness validator in the model. The same thing happens with everything else, everytime an interaction with the database fails (e.g. adding/removing/querying), it breaks the form and gives me "Fatal error: Call to a member function getLabel() on a non-object".
I'm not really sure where to start from here, does anyone know what i might be doing wrong?