public function assetFunction($asset, $serverPath = false) {
        /** @var Request|null $request */
        $request = isset($this->container['request']) ? $this->container['request'] : null;
        $path = \ltrim($asset, '/\\');
        $assetPath = Utils::fixPath($this->container->getRootDir() . '/' . $path);

//        if(!\file_exists($assetPath))
//            throw new FileException("Asset '$asset' with path '$assetPath' not found");

        if(!$serverPath)
            if($request instanceof Request)
                $assetPath = $request->getSchemeAndHttpHost() . '/' . $path;
            else
                $assetPath = '/' . $path;

        return $assetPath;
    }