当前位置: 首页>>代码示例>>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;未经允许,请勿转载。