How to add a new field


In this example, we are going to show you how to add new note field in Clients module in FreelancerHQ script.

A. Add note field in the database

  1. Open your favorite MySQL database admin such as PhPMyAdmin
  2. Open the table clients and view the table's structure



  3. Add the new note field



  4. Save

B. Add the field at client form

  1. Open file /app/View/Clients/admin_add_ajax.ctp and /app/View/Clients/admin_edit_ajax.ctp
  2. Add the following code at the end line of status field:

    echo $this->Form->input('note', array('class' => 'form-control'));

  3. Save

C. Add the field at client view page

  1. Open file /app/View/Clients/admin_view.ctp
  2.  Add the following code at the end line of status field:

    <?php echo __('Note'); ?>: <?php echo $client['Client']['note'] ?>

  3. Save