Skip to content

Instantly share code, notes, and snippets.

@chadkouse
Created January 31, 2013 22:16
Show Gist options
  • Save chadkouse/4687113 to your computer and use it in GitHub Desktop.
Save chadkouse/4687113 to your computer and use it in GitHub Desktop.
<?php
/**
* @uri /lyrics/:artist/:title
*/
class Lyrics extends Tonic\Resource {
/**
* @method GET
* @provides application/json
* @priority 100
* @param $artist
* @param $title
* @return string
*/
function getLyricsJson($artist, $title) {
return json_encode($this->getLyricsInternal($artist, $title));
}
/**
* @method GET
* @provides application/xml
* @priority 1
* @param $artist
* @param $title
* @return string
*/
function getLyricsXML($artist, $title) {
return "not implemented yet";
}
function getLyricsInternal($artist, $title) {
return array("artist"=>$artist, "title"=>$title);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment