本文整理汇总了PHP中Illuminate\Support\Str::finish方法的典型用法代码示例。如果您正苦于以下问题:PHP Str::finish方法的具体用法?PHP Str::finish怎么用?PHP Str::finish使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Str
的用法示例。
在下文中一共展示了Str::finish方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getHomeFolder
/**
* Get the path to the root folder of the application.
*
* @return string
*/
public function getHomeFolder()
{
$rootDirectory = $this->rocketeer->getOption('remote.root_directory');
$rootDirectory = Str::finish($rootDirectory, '/');
$appDirectory = $this->rocketeer->getOption('remote.app_directory') ?: $this->rocketeer->getApplicationName();
return $rootDirectory . $appDirectory;
}
示例2: testStringFinish
public function testStringFinish()
{
$str1 = 'Laravel is really awesome';
$str2 = Str::finish($str1, ' and superb');
$this->assertEquals($str2, 'Laravel is really awesome and superb');
$str1 = 'http://home/';
$str2 = Str::finish($str1, '/');
$this->assertEquals($str2, 'http://home/');
}
示例3:
/**
* Cap a string with a single instance of a given value.
*
* @param string $value
* @param string $cap
* @return string
*/
function str_finish($value, $cap)
{
return Str::finish($value, $cap);
}
示例4: stubPath
/**
* Get the stub path.
*
* @param string $path
*
* @return string
*/
protected function stubPath($path)
{
return Str::finish(__DIR__ . '/../../../stubs', '/') . $path;
}
示例5: finish
/**
* Cap a string with a single instance of a given pattern
**/
public function finish($cap)
{
$this->value = Str::finish($this->value, $cap);
return $this;
}
示例6: generateView
/**
* Generate view with give resource name.
*
* @param string $view
*
* @return void
*/
protected function generateView($view)
{
$path = $this->getPath($this->getPathInput());
$stub = $this->files->get($this->getStubPath($view . '.stub'));
$this->replaceResourceName($stub, $this->getNameInput());
$this->files->put(Str::finish($path, '/') . $view . '.blade.php', $stub);
}