當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。