For instance, I'd like to be able to do this:
--- php ---
class Person
{
private name
private child
... setters and getters ...
}
$person = new Person()
$person->setName("Bob Smith")
$child = new Person()
$child->setName("Bobby Smith, Jr")
$person->setChild($child)
$serialized_person = serialize($person)
-- php --
... pass $serialized_person to client via http ...
-- js --
... include serialize.js from php.js ...
var serialized_person = '<?php echo $serialized_person ?>';
// and unserialize in js
var person = unserialize(serialized_person)
document.write('person name: ' + person.getName())
document.write('child name: ' + person.getChild().getName())
-- js --
Are people already doing it this way? Any help / hints would be good.
Thanks,
Stuart
Brett
--
Met vriendelijke groet / Kind regards,
Kevin van Zonneveld
http://kevin.vanzonneveld.net
I'd be interested to see some code samples of what you are trying to achieve.
Let me know how it goes in any case!