Action Hooks


Perfex CRM support various action hooks all over the code to give the buyers the best experience.

Create file with name my_functions_helper.php in application/helpers/. This file is reserved for all your functions.

TIP: If you need some action hook added anywhere in the code please let us know by opening support ticket.

Before add any code in my_functions_helper.php, make sure that you set development mode in order to see any errors and functions/hooks deprecation warnings.

Version 2.3.0 and above.

hooks()->add_action($tag, $function_to_add, $priority = 10, $accepted_args = 1);
hooks()->add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1);
hooks()->do_action($tag, $arg = '');
hooks()->apply_filters($tag, $value, $additionalParams);
The functions below are prior to version 2.3.0

Add Action Hook

add_action('action_function','your_function_callback');

Example action hook for after_client_added
Note: this code should be inside my_functions_helper.php mentioned earlier.

This is example where the action do not expect to return $data.

function callback_after_client_added_insert_to_local_database($id)
  {
    $clientid = $id;
    // Do Staff with $clientid
  }

  add_action('after_client_added','callback_after_client_added_insert_to_local_database');

Example action hook for before_client_added
This is example where the action expect to return $data

function callback_before_client_added_check_company($data)
  {
      if($data['company'] == 'Test'){
         $data['company'] = '';
      }

      return $data;
  }

  add_action('before_client_added','callback_before_client_added_check_company');

Did you find this article useful?



  • PDF Customization

    File Location This is a general example how to modify the invoice PDF file, check on the bottom of this article for other PDF documents file location...

  • Customers Templates

    If you want to change the client area look copy the existing main theme Perfex located in application/views/themes/ and rename to your theme...

  • Applying custom CSS styles

    Perfex CRM supports custom.css file that will be autoloaded all over the CRM to apply your custom styles. This file don’t exists...

  • Overwrite Translation Text

    If you need to overwrite some translation text you can create your own custom language file. This is used if you want to change some text in the...

  • Add Full Size Login Background Image

    Perfex CRM does not officially support login background image for admin area and customers area to keep the simplicity, but we created simple CSS...