Skip to content

Instantly share code, notes, and snippets.

@speedmax
Created May 13, 2009 12:08
Show Gist options
  • Save speedmax/110990 to your computer and use it in GitHub Desktop.
Save speedmax/110990 to your computer and use it in GitHub Desktop.
class DataObject {
function __construct(object) {}
function __set() {}
function __get() {}
function __isset() {}
static function toInstance($data, $class) {
return new $class($data)
}
static function toCollection($data, $class) {
foreach ($data as &$item) {
$item = new $class($item);
}
return $data;
}
}
class Page extends DataObject {
function url() {
Router::url(array(
}
}
{{ page.title | links_to page }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment