/** * Creates a valid URL to a controler('s method). * * @param mixed $controller Controller object, Classname or _storage_id of the controller * @param string $event Optional method to be called * @return string A valid URL for use in JavaScript wdf object */ public static function Url($controller, $event = '') { if ($controller instanceof HtmlPage) { $controller = log_return("Using classname instead of id to reference controller:", get_class($controller)); } return $controller instanceof Renderable ? "{$controller->_storage_id}/{$event}" : "{$controller}/{$event}/"; }
/** * Returns the last content. * * Note that this does not behave like <Renderable::get>(<last_index>) because it wont throw an <Exception> * when there's no content at last_index, but return a new empty <Control> object. * @return Renderable Last content or new empty <Control> */ function last() { if (count($this->_content) > 0) { return $this->_content[count($this->_content) - 1]; } return log_return("Renderable::last() is empty", new Control()); }