Helper functions for working with URLs.
This is the code documentation for the SproutCMS project
Search documentation |
class UrlHelper functions for working with URLs.
Functions
public addSocialDomainstring Url::addSocialDomain ( string $social_link , string $domain ); Add a domain to provided social link, if it doesn't have one public addUrlSchemestring Url::addUrlScheme ( string $url ); Add a scheme (e.g. 'http://') to a URL which doesn't have one public basestring Url::base ( [ boolean $index [, boolean $protocol ]] ); Base URL, with or without the index page. If protocol is specified, a full URL including the domain will be used otherwise only the root path will be used If a subsite-section has a defined URL prefix, it will be added to the URL automatically public canonicalstring Url::canonical ( string $canonical_url ); Return HTML for canonical URLs public checkRedirectunknown Url::checkRedirect ( string $url [, bool $allow_querysting ] ); Checks the provided argument is a valid redirect URL to the local site This is designed to prevent redirects to other domains, bad pages, etc public currentstring Url::current ( [ boolean $qs ] ); Fetches the current URI. public filestring Url::file ( string $file [, boolean $index ] ); Return the URL to a file. Absolute filenames and relative filenames are allowed. public mergestring Url::merge ( array $arguments ); Merges an array of arguments with the current URI and query string to overload, instead of replace, the current query string. public redirectvoid Url::redirect ( [ mixed $uri [, string $method ]] ); Sends a page redirect header and runs the system.redirect Event. public sitestring Url::site ( [ string $uri [, string $protocol ]] ); Fetches an absolute site URL based on a URI segment. public withoutArgsunknown Url::withoutArgs ( ); Removes one or more argumens from the current URL, returning a URL which can have arguments appended to it Multiple arguments can be specified If the current URL is: /search?q=test&category=general and the function call is: Url::withoutArgs('q') the resulting URL will be: /search?category=general& Use rtrim($url, '&?') if you do not desire the trailing ? or & |
Powered by Pelzini, version 0.9.0 |
Documentation is made available under the
GNU Free Documentation License 1.2. Generated: Monday, 3rd April, 2023 at 02:59 pm |