当前位置: 首页>>代码示例>>PHP>>正文


PHP Str::finish方法代码示例

本文整理汇总了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;
 }
开发者ID:marcelgwerder,项目名称:rocketeer,代码行数:12,代码来源:Pathfinder.php

示例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/');
 }
开发者ID:aapiro,项目名称:laravel-strings-examples,代码行数:9,代码来源:HelpersStringsTest.php

示例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);
 }
开发者ID:saj696,项目名称:pipe,代码行数:11,代码来源:helpers.php

示例4: stubPath

 /**
  * Get the stub path.
  *
  * @param string $path
  *
  * @return string
  */
 protected function stubPath($path)
 {
     return Str::finish(__DIR__ . '/../../../stubs', '/') . $path;
 }
开发者ID:jenky,项目名称:laravel-generators,代码行数:11,代码来源:GeneratorCommand.php

示例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;
 }
开发者ID:acid-solutions,项目名称:value-objects,代码行数:8,代码来源:String.php

示例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);
 }
开发者ID:jenky,项目名称:laravel-generators,代码行数:14,代码来源:ViewMakeCommand.php


注:本文中的Illuminate\Support\Str::finish方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。