__get() and __call() methods
<?php
class SomeClass
{
public function __get($prop)
{
if (property_exists($this->router, $prop)) {
return $this->router->$prop;
}
}
public function __call($method, $args)
{
if (method_exists($this->router, $method)) {
return call_user_func_array(array($this->router, $method), $args);
}
}
}