Created
May 13, 2009 12:08
-
-
Save speedmax/110990 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ page.title | links_to page }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment