The Client Cloud

The Client Cloud

Recently finished up a project called The Client Cloud which I developed from scratch utilizing my framework Virge.

It allows to cheaply manage a small business' clients, manage their payment history, assign them to groups, and add tags. It also generates some rudimentary reports.

Development went along quickly due to the fact that I recently introduced a way of creating forms to modify objects quickly. Whenever I find myself doing the same thing over and over, from project to project, I set out to find a way to streamline it. One of the things I did over and over again, was creating forms to create/edit objects that tied back to a database.

Utilizing Twitter Bootstrap for the styles, I created a few classes, a Form, Fieldset, and Field.

The Form was tied to a Handler (Controller), and could have fieldsets added. These fieldsets could be normal fieldsets that containes text,number,date, and file fields, or link to another Handler which would handle its displaying and saving capabilities.

 

$fieldset = $this->addFieldset(array(

    'label' => 'General Information',

));

 

First step would be to add a fieldset. The form would render in the order of fieldsets added and fields added to those fieldsets. Each standard field was added to the object created.

 

$fieldset->addField('first_name', array(

    'label' => 'First Name',

    'type' => 'text',

    'default_value' => '',

    'required' => true

));

 

Each field could have a type, or a custom renderer. Upon saving, the code loops through each fieldset, and each field, and saves the value to the supplied Model (which ties back to a specific database table). This allowed me to quickly create forms on the frontend like the one below.

Comments
comments powered by Disqus