+1 571-297-6383 | info@sonjara.com

Developer Blogs

A Programmer's View of Fakoli.

- Janice Gallant

On my first day at Sonjara, my supervisor spent about half an hour introducing me to the Fakoli development Framework, the DataItem class structure for data modeling, and the AutoForm class for rendering web forms. Then he sent me off to start building a data entry interface. Using the existing code base, I found examples of web forms and could easily discern the basic elements: create an instance of a DataItem class, give it to the class AutoForm, and draw the form. I had my first form up and running in a few hours. Then, I thought about ways it needed to be customized and could see that $form->alias(...) was used to rename a field label, $form->hide() was used to avoid showing fields from the record that the user doesn't need to fill in. Pretty soon, the form was rendering exactly the way I wanted.

Although Fakoli offers many customization options, sometimes we need a behavior it doesn't offer. I really like having the ability to either add an option to a Fakoli class if it might be a useful feature or override functions or create my own classes when a project requires a high level of customization. Fakoli builds a web form by bringing together parts from field renderer and validation classes. If any one of the existing classes doesn't meet our needs, we just create a new one, and hand it over to AutoForm. For one project, we needed a button next to a StringRenderer so we created a class that extends StringRenderer and overrides the function _endField to render the button. Other times we need special validation, such as an "amount" field is only required if "Approved" radio button is selected. In this case, we can create a custom validator, tell AutoForm to add it to the ValidationEngine and AutoForm will validate that special condition along with any others, such as required fields. I love being able to say, "Sure, no problem, I can do that." instead of "Sorry, Fakoli doesn't support that."

I think what I like best about Fakoli is that I don't spend a lot of time on low-level coding tasks, like building SQL statements and rendering fields. Instead, I can spend time thinking about how to solve complex problems and how to structure the code in the most extensible, reuseable way. It frees my time to spend on the parts of my job that I enjoy the most.