October\Rain\Html\UrlMixin
Protected Properties
protected mixed $provider
Public Methods
public __construct()
public __construct($provider): void
public assetRelative()
public assetRelative($path): string
assetRelative generates an asset URL, returning a full URL when app.asset_url is configured, otherwise a relative URL prefixed with the request base path.
public assetVersion()
public assetVersion($path): string
assetVersion takes a disk path, resolves it to a public URL, and appends a cache-busting version query string based on the file's modification time.
Supports path symbols: ~ (base), $ (plugins), # (themes)
Url::assetVersion('~/themes/demo/assets/js/app.js')
// → http://localhost/themes/demo/assets/js/app.js?v1a2b3c4d
public makeRelative()
public makeRelative($url): void
makeRelative converts a full URL to a relative URL
public toRelative()
public toRelative($url): void
toRelative makes a link relative if configuration asks for it
public toSigned()
public toSigned($url, $expiration = null, $absolute = true): void
toSigned signs a bare URL that can be validated with hasValidSignature
Protected Methods
protected availableAt()
protected availableAt(DateTimeInterface|\DateInterval|int $delay = 0): int
Get the "available at" UNIX timestamp.
protected currentTime()
protected currentTime(): int
Get the current system time as a UNIX timestamp.
protected parseDateInterval()
protected parseDateInterval(
DateTimeInterface|\DateInterval|int $delay
): DateTimeInterface|int
If the given value is an interval, convert it to a DateTime instance.
protected runTimeForHumans()
protected runTimeForHumans(
float $startTime,
float|null $endTime = null
): string
Given a start time, format the total run time for human readability.
protected secondsUntil()
protected secondsUntil(DateTimeInterface|\DateInterval|int $delay): int
Get the number of seconds until the given DateTime.