I have a form factory class that builds the form based on data in an array.
Each element is represented as a class as well.
The form elements each have a toString implementation that spits out the html for that kind of element and the form itself has a toString implementation that simply folds it's array of elements into a string.
My problem is that when there is an error I simply get 'toString cannot through an exception' which is really not much help when the form element in question has two parent classes. ConcreteFormElement >> OptionFormElement >> Select ( a dropdown ). The error could be anywhere in between.
This is a WordPress theme and I'm doing it entirely using OOP practice mainly as an excercise for learning.
It seems only natural to me to use toString but the print_f debugging is getting me down. Am I doing something wrong? Should I forget about toString? Or is there someway to debug easier?
P.S. Is the question too vague?