mongosoft\file\UploadBehavior::resolvePath PHP Метод

resolvePath() защищенный Метод

Replaces all placeholders in path variable with corresponding values.
protected resolvePath ( $path )
    protected function resolvePath($path)
    {
        /** @var BaseActiveRecord $model */
        $model = $this->owner;
        return preg_replace_callback('/{([^}]+)}/', function ($matches) use($model) {
            $name = $matches[1];
            $attribute = ArrayHelper::getValue($model, $name);
            if (is_string($attribute) || is_numeric($attribute)) {
                return $attribute;
            } else {
                return $matches[0];
            }
        }, $path);
    }