Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a README

  • Loading branch information...
commit 69e855105e650df96faa3d68566ac98db665b390 1 parent 078aa1e
@iammerrick authored
Showing with 31 additions and 0 deletions.
  1. +31 −0 README.md
View
31 README.md
@@ -0,0 +1,31 @@
+# Sleepy - A Restful Modeler
+
+ <?php
+
+ class Model_User extends Sleepy {
+
+ protected $_data_url = 'http://restfulserver.com/user/';
+
+ protected $_data = array(
+ 'id' => '',
+ 'username' => '',
+ 'email' => '',
+ );
+ }
+
+ $user = Sleepy::factory('user');
+ $user->load(); // Runs a GET method on the $_data_url and updates the data.
+
+ $user->username = 'iammerrick'; // Change the user name.
+
+ $user->save(); // Posts the updated $_data via to the $_data_url
+
+ Sleep::factory('user')
+ ->set_fields($_POST, array('username', 'email'))
+ ->save(); // Posts the $_data via JSON to the $_data_url and sets $_data with the JSON response
+
+
+
+
+
+ ?>
Please sign in to comment.
Something went wrong with that request. Please try again.