You are here

function ctools_ajax_sample_hello in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 ctools_ajax_sample/ctools_ajax_sample.module \ctools_ajax_sample_hello()

Returns a "take it all over" hello world style request.

1 string reference to 'ctools_ajax_sample_hello'
ctools_ajax_sample_menu in ctools_ajax_sample/ctools_ajax_sample.module
Implementation of hook_menu()

File

ctools_ajax_sample/ctools_ajax_sample.module, line 222
Sample AJAX functionality so people can see some of the CTools AJAX features in use.

Code

function ctools_ajax_sample_hello($js = NULL) {
  $output = '<h1>' . t('Hello World') . '</h1>';
  if ($js) {
    ctools_include('ajax');
    $commands = array();
    $commands[] = ajax_command_html('#ctools-sample', $output);

    // This function exits.
    print ajax_render($commands);
    exit;
  }
  else {
    return $output;
  }
}