Skip to content

Instantly share code, notes, and snippets.

@Logiks
Created February 17, 2014 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Logiks/9052042 to your computer and use it in GitHub Desktop.
Save Logiks/9052042 to your computer and use it in GitHub Desktop.
This works as boiler plate for starting any service file be it a global or a modules specific service. #Logiks-Boilerplates
<?php
if(!defined('ROOT')) exit('No direct script access allowed');
if(isset($_REQUEST["action"])) {
switch($_REQUEST["action"]) {
case "default":
$dataArr=array();
//Prints formated data to output stream be it xml,json,html,text or csv
printServiceMsg($dataArr);
break;
}
} else {
//Prints formated error msg to output stream be it xml,json,html,text or csv
printServiceErrorMsg("Sorry, Action Not Found");
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment