예제 #1
0
파일: UrlHelper.php 프로젝트: Liv1020/cms
 /**
  * @return static
  */
 public static function getCurrent()
 {
     if (static::$currentUrl === null) {
         //TODO: доработать вычисление текущего роута
         static::$currentUrl = static::constructCurrent();
     }
     return static::$currentUrl;
 }
예제 #2
0
 /**
  * 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;
 }