Created
March 4, 2014 11:22
-
-
Save imvision/9344675 to your computer and use it in GitHub Desktop.
Experimental Front Controller that can return content in multiple formats.
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 | |
require "startup.php"; | |
$action = (isset($_REQUEST['action']) && $_REQUEST['action']!="" && file_exists(__DIR__."/{$_REQUEST['action']}.php")) ? $_REQUEST['action'] : "sources"; | |
?> | |
<?php if(! isset($_REQUEST['request_type']) || $_REQUEST['request_type']!="ajax"): ?> | |
<?php include('header.php');?> | |
<div id="content"> | |
<?php endif;?> | |
<?php require __DIR__."/{$action}.php";?> | |
<?php if(! isset($_REQUEST['request_type']) || $_REQUEST['request_type']!="ajax"): ?> | |
</div> | |
<?php include('footer.php');?> | |
<?php endif;?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment