function ctools_ajax_sample_hello in Chaos Tool Suite (ctools) 6
Same name and namespace in other branches
- 7 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 164 - 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[] = ctools_ajax_command_html('#ctools-sample', $output);
ctools_ajax_render($commands);
// this function exits.
}
else {
return $output;
}
}