In this example we are going to create a web service which returns a JSON formatted string. This request could be called from almost any type of AJAX or Javascrpt HTTP Request which expects a JSON formatted response.
Test the example: http://kerkness.ca/kerkdemo/hello.world
Example 1
Create the directory kerk/modules/hello/
Inside the ‘hello’ directory create the file ‘world.php’ and add the following to it.
<?php
$kerk->addContent('myvar', 'Hello World');
?>
Now you can make a request for this service by calling http://kerkness.ca/kerkdemo/hello.world and see the following response
{"content":{"myvar":"Hello World"}}
0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.