PHP: Chainable cURL Object Oriented API
In my Chainable post :
https://coderwall.com/p/dmuoqa
I got some requests for an example of a pratical use of the method chaining wrapper.
Remember the cURL Object Oriented API Class?
https://coderwall.com/p/f9qjvw
Let's combine them into a
dynamic-chainable-object-oriented-api! ;)
(new Chainable(
new cURL("http://graph.facebook.com/CaffeinaLab")
)) -> setopt(CURLOPT_HEADER, 0)
-> setopt(CURLOPT_RETURNTRANSFER, 1)
-> exec() -> _get_return($data)
-> close()
;
print_r( json_decode( $data ) );
Written by Stefano Azzolini
Related protips
1 Response
huh! that explains it I guess. I'll give it a bash and try creating a chainable method on my own and let you know if I have any further confusions. thanks man, appreciate your response. :)
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#