Skip to content
This repository has been archived by the owner on Dec 6, 2017. It is now read-only.

iammerrick/Sleepy

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

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





?>

About

A Restful Module For Kohana

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages