Created
April 8, 2011 11:01
-
-
Save steffenr/909642 to your computer and use it in GitHub Desktop.
HTTP_X_REQUESTED - new template file
This file contains hidden or 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 | |
function mytheme_preprocess_page(&$variables) { | |
// wurde die seite über AJAX request aufgerufen? | |
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' ) { | |
$variables['template_files'] = is_array($variables['template_files']) ? $variables['template_files'] : array(); | |
// füge ein neues template hinzu | |
$variables['template_files'][] = 'page-xhttp'; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment