(2017-08-14, 19:20:12)Bigin Wrote: Your controller, a few lines in the functions.php:
PHP Code:if(!empty($_GET['getPageContent'])) {
echo json_encode(your_function($_GET['getPageContent']));
exit();
}
Your processor (could be a function in your functions.php file):
PHP Code:function your_function($slug) {
$data = null;
$id = null;
$id = lowercase(str_replace('/', '', str_replace('..', '', $slug)));
if($id) {
$data = getXml(GSDATAPAGESPATH.$id.'.xml');
}
return isset($data->content) ? array('content' => (string)$data->content) : null;
}
I'm trying to tackle something similar to this. I'm wondering if I can pass the slug w/o the controller?
Thanks for any info.