diff --git a/docs/api.php b/docs/api.php index abd5016..781eec7 100644 --- a/docs/api.php +++ b/docs/api.php @@ -1,5 +1,5 @@ setup(); - $this->bind(); + if (isset($_GET['howto'])){ + $this->howto(); + } else { + $this->setup(); + $this->bind(); + } } //setup @@ -72,6 +76,20 @@ class api { } + //howto + function howto() { + $form_action = $_SERVER['PHP_SELF']; + + $smarty = new Smarty; + $smarty->force_compile = true; + $smarty->compile_dir = SMARTY_COMPILE_DIRECTORY; + + $smarty->assign("page_title","API HOWTO"); + $smarty->assign("menu_item","api"); + + $smarty->display('apihowto.tpl'); + } + } diff --git a/docs/templates/apihowto.tpl b/docs/templates/apihowto.tpl new file mode 100644 index 0000000..484ec52 --- /dev/null +++ b/docs/templates/apihowto.tpl @@ -0,0 +1,22 @@ +{include file="header.tpl"} + +
+ http://www.planningalerts.com/api.php?
+ lat=[some latitude]
+ &lng=[some longitude]
+ &postcode=[some postcode]
+ &area_size=['s' 'm' or 'l']
+
+
+ an example query
+