lithium\net\http\Media::webroot()

public static method

Gets the physical path to the web assets (i.e. /webroot) directory of a library.

Parameters

  • string|boolean $library

    The name of the library for which to find the path, or true for the default library.

  • string|boolean $scope

    The name of the to use to find the path.

Returns

string

Returns the physical path to the web assets directory.

Source

	public static function webroot($library = true, $scope = null) {
		if ($scope) {
			if ($config = static::attached($scope)) {
				return $config['path'];
			}
			return null;
		}
		if (!$config = Libraries::get($library)) {
			return null;
		}
		if (isset($config['webroot'])) {
			return $config['webroot'];
		}
		if (isset($config['path'])) {
			return $config['path'] . '/webroot';
		}
	}