You are here

function Provision_Service_example_basic::config_data in Hosting 7.4

Same name and namespace in other branches
  1. 7.3 example/example_service/drush/Provision/Service/example/basic.php \Provision_Service_example_basic::config_data()

Pass additional values to the config file templates.

Even though the $server variable will be available in your template files, you may wish to pass additional calculated values to your template files.

Consider this something like the hook_preprocess stuff in drupal.

File

example/example_service/drush/Provision/Service/example/basic.php, line 106
A 'basic' implementation of the 'example' service type.

Class

Provision_Service_example_basic
A class containing the 'basic' implementation of the 'example' service.

Code

function config_data($config = null, $class = null) {

  // This format of calling the parent is very important!
  $data = parent::config_data($config, $class);

  /**
   * This value will become available as $example_current_time
   * in all the config files generated by this service.
   *
   * You could also choose to only conditionally pass values based on
   * the parameters.
   */
  $data['example_current_time'] = date(DATE_COOKIE, time());
  return $data;
}