Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Strip whitespace (or other characters) from the end of a string
<?php rtrim(string $string, string $characters = " \n\r\t\v\x00"): string
<?php public function diskPath()
{
return rtrim($this->disk()->path('/'), '/');
}
public function path()
<?php public function path()
{
return vsprintf('%s/%s.yaml', [
rtrim(Stache::store('asset-containers')->directory(), '/'),
$this->handle(),
]);
}
<?php public function url()
{
$url = rtrim($this->disk()->url('/'), '/');
return ($url === '') ? '/' : $url;
}
<?php return null;
}
$siteUrl = rtrim(Site::current()->absoluteUrl(), '/');
$containerUrl = $container->url();
if (starts_with($containerUrl, '/')) {
<?php public function path()
{
return vsprintf('%s/%s.yaml', [
rtrim(Stache::store('users')->directory(), '/'),
$this->email(),
]);
}
<?php public function path()
{
return vsprintf('%s/%s.yaml', [
rtrim(Stache::store('collections')->directory(), '/'),
$this->handle,
]);
}
<?php }
return vsprintf('%s/%s/%s%s%s.%s', [
rtrim(Stache::store('entries')->directory(), '/'),
$this->collectionHandle(),
Site::hasMultiple() ? $this->locale().'/' : '',
$prefix,
<?php $reflector = new ReflectionClass($this->provider);
$dir = Str::removeRight(dirname($reflector->getFileName()), rtrim($this->autoload, '/'));
return $this->directory = Str::ensureRight($dir, '/');
}
<?php $namespace = implode('\\', $providerParts);
$autoload = $package['autoload']['psr-4'][$namespace.'\\'];
$directory = Str::removeRight(dirname($reflector->getFileName()), rtrim($autoload, '/'));
$json = json_decode(File::get($directory.'/composer.json'), true);
$statamic = $json['extra']['statamic'] ?? [];
<?php public function prependSiteUrl($url, $locale = null, $controller = true)
{
$prepend = rtrim(Config::getSiteUrl($locale), '/');
<?php public function setRootDirectory($directory)
{
$this->root = rtrim($directory, '/\\');
return $this;
}
<?php public function path()
{
return vsprintf('%s/%s.%s', [
rtrim(Stache::store('globals')->directory(), '/'),
$this->handle(),
'yaml',
]);
<?php public function path()
{
return vsprintf('%s/%s%s.%s', [
rtrim(Stache::store('globals')->directory(), '/'),
Site::hasMultiple() ? $this->locale().'/' : '',
$this->handle(),
'yaml',
<?php }
if (Str::endsWith($url, '/') && Str::length($url) > 1) {
$url = rtrim($url, '/');
}
if ($data = Data::findByUri($url, Site::current()->handle())) {
<?php public function __construct($base, ClientInterface $client = null, $supportsHead = true)
{
$this->base = rtrim($base, '/').'/';
$this->client = $client ?: new Client();
$this->supportsHead = $supportsHead;