Last active
August 29, 2015 14:09
-
-
Save alessandro-fazzi/d2e4c4b32e84ea686594 to your computer and use it in GitHub Desktop.
Wordless router ready for ajax partial rendering
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
.page-item#ascolta= render_partial('music/home') | |
.page-item#guarda | |
%i.fa.fa-video-camera.fa-spin | |
:javascript | |
jQuery.get('/', {ajax: 'video/home'}, function(data, textStatus, xhr) { | |
jQuery('#guarda').html(data); | |
}); |
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 | |
if ( isset( $_GET['ajax'] ) ){ | |
render_partial( $_GET['ajax'] ); | |
} elseif (is_front_page()){ | |
render_view("home/content"); | |
} else { | |
render_view("posts/404"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment