/** * @return static */ public static function getCurrent() { if (static::$currentUrl === null) { //TODO: доработать вычисление текущего роута static::$currentUrl = static::constructCurrent(); } return static::$currentUrl; }
/** * Sets the current model, so \CMF::currentModel() will return this one. * * @param object $model */ public static function setCurrentModel($model) { $model_class = get_class($model); static::$template = $model_class::template(); if (property_exists($model, 'url') && ($urlItem = $model->get('url'))) { static::$currentUrl = $urlItem; } return static::$model = $model; }