-
Notifications
You must be signed in to change notification settings - Fork 1
makasim/JRM
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Javascript Remote Mapper Php workflow: 1) Set objects mapping: JRM::setMap(array('User' => 'app.model.User')); 2) Add interafce and implement interface IJRMSerializable: class User implements IJRMSerializable { /** * @return array */ public function getJrmProperties() { return array( 'name' => $this->_name, 'id' => $this->_id, 'email' => $this->_email); } /** * * @param array $array * @return bool */ public function setJrmProperties($array) { $this->_name = $array['name']; $this->_id = $array['id']; $this->_email = $array['email']; return true; } 3) Send data to the client: json_encode(JRM::serialize($widget)) Javascript workflow: 1) Create a User (JS.Class lib is needed): user = new Class(Model, { id : '', name : '', email : '' }); 2) Unserialize response data: user = JRM.unserialize(data);
About
It's an ORM for converting PHP data to Javascript and back.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published