Welcome Guest, Not a member yet? Register   Sign In
Introducing...REST!
#11

[eluser]Lovecannon[/eluser]
well, I have functions that do JSON decoding/encoding,
$this->rest->jsonEncode and $this->rest->jsonDecode, just pass a variable to jsonEncode to encode it into JSON, it can be an array or object. and to decode use jsonDecode


Code:
class Api extends Controller
{
function _test($data)
    {
        $this->load->library('rest');
        echo $this->rest->jsonEncode($obj_to_encode_into_json);
    }
function rest()
{
    $this->load->library('rest');
    $this->rest->addFunction('test', '_test', 'get');          
    $this->rest->addFunction('testpost', '__test', 'post');
    $this->rest->serve($this); //You have to pass a reference to the object that has the methods. In this example, it would be the controller. */
}
}
#12

[eluser]ecarsted[/eluser]
[quote author="Lovecannon" date="1207417120"]Hmm...Im gonna have to fix that..but Im going to have an update of my REST library soon, that will try and fix that error, and add some extra features.[/quote]

Hmm, I would test first if $_SERVER[PATH_INFO] is not set and then execute your code, that way you wont clobber it, but that is just me. Smile (new to PHP)

Eric
#13

[eluser]Lovecannon[/eluser]
Yeah, I didnt think the ternary statement would break it if it wasnt already set, Ill have to take care of it.
#14

[eluser]Lovecannon[/eluser]
And I just realized that statement wasnt even supposed to be in there, Ill have to remove it by next release
#15

[eluser]noinput[/eluser]
[quote author="Lovecannon" date="1204507823"]Download:

http://fuzzfist.com/upload/dl/kMndqr10[/quote]

Does anyone have a copy of the zip file? Looks like the download location is bad.
Looking forward to trying it out! thanks.
#16

[eluser]Lovecannon[/eluser]
Yeah, that site got taken down, Ill have to post a new link soon. My bad.
#17

[eluser]noinput[/eluser]
[quote author="Lovecannon" date="1213510197"]Yeah, that site got taken down, Ill have to post a new link soon. My bad.[/quote]

No prob, let me know if you need some webspace to host it, I can put it on my server for you. From the overview you posted the package looks awesome, can't wait to try it for the site I'm developing right now.

jim.
#18

[eluser]jstrebel[/eluser]
Would be interested to see this. I am implementing a full flickr API lib into our CI site, would like to us REST rather than xml-rpc.
#19

[eluser]hotmeteor[/eluser]
Has this been put back up yet?
#20

[eluser]Lovecannon[/eluser]
Here is a new link: http://www.mediafire.com/?t4g753ydmtp




Theme © iAndrew 2016 - Forum software by © MyBB