function outputformat_drush_engine_topic_additional_text

8.0.x outputformat.drush.inc outputformat_drush_engine_topic_additional_text($engine, $instance, $config)
6.x outputformat.drush.inc outputformat_drush_engine_topic_additional_text($engine, $instance, $config)
7.x outputformat.drush.inc outputformat_drush_engine_topic_additional_text($engine, $instance, $config)
master outputformat.drush.inc outputformat_drush_engine_topic_additional_text($engine, $instance, $config)

Implements hook_drush_engine_topic_additional_text().

File

commands/core/outputformat.drush.inc, line 320
Core drush output formats.

Code

function outputformat_drush_engine_topic_additional_text($engine, $instance, $config) {
  $result = array();

  // If the output format engine has a 'topic-example' in
  // its configuration, then format the provided array using
  // the output formatter, and insert the result of the
  // transform into the topic text.
  if ($engine == 'outputformat') {
    if (array_key_exists('topic-example', $config)) {
      $code = $config['topic-example'];
      $formatted = drush_format($code, array(), $instance);
      $result[] = dt("Code:\n\nreturn !code;\n\nOutput with --format=!instance:\n\n!formatted", array('!code' => var_export($code, TRUE), '!instance' => $instance, '!formatted' => $formatted));
    }
  }

  return $result;
}