Created
January 26, 2013 06:21
-
-
Save drupalista-br/4640536 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_menu(). | |
* | |
* Sets up calls to drupal_get_form() for all our example cases. | |
* | |
* @see menu_example.module | |
* @see menu_example_menu() | |
*/ | |
function ajax_example_menu() { | |
$items = array(); | |
... | |
// Use the AJAX framework outside the context of a form using the use-ajax | |
// class. See ajax_example_misc.inc. | |
$items['examples/ajax_example/ajax_link'] = array( | |
'title' => 'Ajax Link ("use-ajax" class)', | |
'page callback' => 'ajax_example_render_link', | |
'access callback' => TRUE, | |
'file' => 'ajax_example_misc.inc', | |
'weight' => 9, | |
); | |
// Use the AJAX framework outside the context of a form using a renderable | |
// array of type link with the #ajax property. See ajax_example_misc.inc. | |
$items['examples/ajax_example/ajax_link_renderable'] = array( | |
'title' => 'Ajax Link (Renderable Array)', | |
'page callback' => 'ajax_example_render_link_ra', | |
'access callback' => TRUE, | |
'file' => 'ajax_example_misc.inc', | |
'weight' => 9, | |
); | |
// A menu callback is required when using ajax outside of the Form API. | |
$items['ajax_link_callback'] = array( | |
'page callback' => 'ajax_link_response', | |
'access callback' => 'user_access', | |
'access arguments' => array('access content'), | |
'type' => MENU_CALLBACK, | |
'file' => 'ajax_example_misc.inc', | |
); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment