當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GeneratorCommand::replaceClass方法代碼示例

本文整理匯總了PHP中Illuminate\Console\GeneratorCommand::replaceClass方法的典型用法代碼示例。如果您正苦於以下問題:PHP GeneratorCommand::replaceClass方法的具體用法?PHP GeneratorCommand::replaceClass怎麽用?PHP GeneratorCommand::replaceClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Console\GeneratorCommand的用法示例。


在下文中一共展示了GeneratorCommand::replaceClass方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: replaceClass

 protected function replaceClass($stub, $name)
 {
     $stub = parent::replaceClass($stub, $name);
     $noControllerName = str_replace('Controller', '', $this->getNameInput());
     $dummyRoute = config('administr.prefix') . '.' . str_plural(strtolower(snake_case($noControllerName, '-')));
     $stub = str_replace('dummyroute', $dummyRoute, $stub);
     $appNamespace = $this->getLaravel()->getNamespace();
     $dummyModel = str_singular($noControllerName);
     $dummyModelNamespaced = $appNamespace . 'Models\\' . $dummyModel;
     $stub = str_replace('DummyModelNamespaced', $dummyModelNamespaced, $stub);
     $stub = str_replace('DummyModel', $dummyModel, $stub);
     $dummyForm = str_singular($noControllerName) . 'Form';
     $dummyFormNamespaced = $appNamespace . 'Http\\Forms\\' . $dummyForm;
     $stub = str_replace('DummyFormNamespaced', $dummyFormNamespaced, $stub);
     $stub = str_replace('DummyForm', $dummyForm, $stub);
     $dummyListView = str_plural($noControllerName) . 'ListView';
     $dummyListViewNamespaced = $appNamespace . 'Http\\ListViews\\' . $dummyListView;
     $stub = str_replace('DummyListViewNamespaced', $dummyListViewNamespaced, $stub);
     $stub = str_replace('DummyListView', $dummyListView, $stub);
     $viewPath = config('administr.viewPath');
     if (strlen($viewPath) > 0) {
         $viewPath .= '.';
     }
     $dummyView = $viewPath . str_plural(snake_case(class_basename($noControllerName), '-'));
     $stub = str_replace('dummyview', $dummyView, $stub);
     return $stub;
 }
開發者ID:administrcms,項目名稱:administr,代碼行數:27,代碼來源:MakeAdminController.php

示例2: replaceClass

 /**
  * Replace the class name for the given stub.
  *
  * @param string $stub
  * @param string $name
  *
  * @return string
  */
 protected function replaceClass($stub, $name)
 {
     $stub = parent::replaceClass($stub, $name);
     return str_replace(['DummyModelNamespace', 'DummyModel'], [$this->option('model'), class_basename($this->option('model'))], $stub);
 }
開發者ID:z-song,項目名稱:laravel-admin,代碼行數:13,代碼來源:MakeCommand.php

示例3: replaceClass

 protected function replaceClass($stub, $name)
 {
     $stub = parent::replaceClass($stub, $name);
     $noListViewName = str_replace('ListView', '', $this->getNameInput());
     $dummyRoute = config('administr.prefix') . '.' . str_plural(strtolower(snake_case($noListViewName, '-')));
     $stub = str_replace('dummyroute', $dummyRoute, $stub);
     return $stub;
 }
開發者ID:administrcms,項目名稱:listview,代碼行數:8,代碼來源:MakeListView.php

示例4: replaceClass

 /**
  * Replace the class name for the given stub.
  *
  * @param  string  $stub
  * @param  string  $name
  * @return string
  */
 protected function replaceClass($stub, $name)
 {
     $stub = parent::replaceClass($stub, $name);
     $parseClass = $this->option('parse-class') ?: $this->argument('name');
     return str_replace('{{parseClass}}', $parseClass, $stub);
 }
開發者ID:khangaikh,項目名稱:golocal,代碼行數:13,代碼來源:RepositoryMakeCommand.php

示例5: replaceClass

 /**
  * @param string $stub
  * @param string $name
  *
  * @return mixed
  */
 protected function replaceClass($stub, $name)
 {
     $stub = parent::replaceClass($stub, $name);
     return str_replace('DummyDatetime', Carbon::now()->toDateTimeString(), $stub);
 }
開發者ID:notadd,項目名稱:framework,代碼行數:11,代碼來源:JobMakeCommand.php

示例6: replaceClass

 /**
  * Replace the class name for the given stub.
  *
  * @param  string  $stub
  * @param  string  $name
  * @return string
  */
 protected function replaceClass($stub, $name)
 {
     $stub = parent::replaceClass($stub, $name);
     return str_replace('{{command}}', $this->option('command'), $stub);
 }
開發者ID:devonzara,項目名稱:framework,代碼行數:12,代碼來源:ConsoleMakeCommand.php

示例7: replaceClass

 /**
  * Replace the class name for the given stub.
  *
  * @param string $stub
  * @param string $name
  *
  * @return string
  */
 protected function replaceClass($stub, $name)
 {
     $stub = parent::replaceClass($stub, $name);
     $stub = str_replace('DummyDatetime', Carbon::now()->toDateTimeString(), $stub);
     return str_replace('dummy:command', $this->option('command'), $stub);
 }
開發者ID:notadd,項目名稱:framework,代碼行數:14,代碼來源:ConsoleMakeCommand.php

示例8: replaceClass

 protected function replaceClass($stub, $name)
 {
     $stub = parent::replaceClass($stub, $name);
     return str_replace('DummyName', trim(Str::snake($this->argument('name'))), $stub);
 }
開發者ID:larakit,項目名稱:lk,代碼行數:5,代碼來源:CommandQuickformMakeForm.php

示例9: replaceClass

 /**
  * Replace the class name for the given stub.
  *
  * @param  string  $stub
  * @param  string  $name
  * @return string
  */
 protected function replaceClass($stub, $name)
 {
     $stub = parent::replaceClass($stub, $name);
     return str_replace('{{request.namespace}}', $this->laravel['config']['namespaces.requests'], $stub);
 }
開發者ID:AlexCutts,項目名稱:framework,代碼行數:12,代碼來源:AuthControllerCommand.php


注:本文中的Illuminate\Console\GeneratorCommand::replaceClass方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。