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


PHP Console\GeneratorCommand类代码示例

本文整理汇总了PHP中Illuminate\Console\GeneratorCommand的典型用法代码示例。如果您正苦于以下问题:PHP GeneratorCommand类的具体用法?PHP GeneratorCommand怎么用?PHP GeneratorCommand使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了GeneratorCommand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     parent::fire();
     if (!$this->option('plain')) {
         $this->createView();
     }
 }
开发者ID:ngangchill,项目名称:laravel-widgets,代码行数:12,代码来源:WidgetMakeCommand.php

示例3: buildClass

 /**
  * Build the class with the given name.
  *
  * @param  string $name
  * @return string
  */
 protected function buildClass($name)
 {
     $stub = parent::buildClass($name);
     $modelName = $this->getModelClass($name);
     $this->replaceModelNamespace($stub, $modelName)->replaceModelClass($stub, $modelName)->replaceBaseRepositoryNamespace($stub, $this->base)->replaceBaseRepositoryClass($stub, $this->base);
     return $stub;
 }
开发者ID:czim,项目名称:laravel-repository,代码行数:13,代码来源:MakeRepositoryCommand.php

示例4: fire

 /**
  * Execute the command.
  *
  * @return void
  */
 public function fire()
 {
     parent::fire();
     if ($this->option('handler')) {
         $this->call('handler:command', ['name' => $this->argument('name') . 'Handler', '--command' => $this->parseName($this->argument('name'))]);
     }
 }
开发者ID:ngitimfoyo,项目名称:Nyari-AppPHP,代码行数:12,代码来源:CommandMakeCommand.php

示例5: buildClass

 /**
  * Build the class with the given name.
  *
  * @param  string  $name
  * @return string
  */
 protected function buildClass($name)
 {
     $stub = parent::buildClass($name);
     $stub = str_replace('DummyCommand', class_basename($this->option('command')), $stub);
     $stub = str_replace('DummyFullCommand', $this->option('command'), $stub);
     return $stub;
 }
开发者ID:qasem2rubik,项目名称:laravel,代码行数:13,代码来源:HandlerCommandCommand.php

示例6: __construct

 /**
  * Create a new config clear command instance.
  *
  * @param Filesystem $files
  */
 public function __construct(Filesystem $files)
 {
     parent::__construct($files);
     $this->useEloquent = config('json-api.generator.use-eloquent', true);
     $this->subNamespace = config('json-api.generator.namespace', 'JsonApi');
     $this->namespaceByResource = config('json-api.generator.by-resource', true);
     $this->stubsDirectory = __DIR__ . '/../../../stubs';
 }
开发者ID:cloudcreativity,项目名称:laravel-json-api,代码行数:13,代码来源:AbstractGeneratorCommand.php

示例7: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     if (parent::fire() !== false && $this->option('translated')) {
         $name = $this->getNameInput();
         $this->type = 'Admin model translation class';
         $this->call('administr:model', ['name' => "{$name}Translation"]);
     }
 }
开发者ID:administrcms,项目名称:localization,代码行数:13,代码来源:MakeAdminModel.php

示例8: buildClass

 /**
  * Build the class with the given name.
  *
  * @param  string  $name
  * @return string
  */
 protected function buildClass($name)
 {
     $class = parent::buildClass($name);
     if ($this->option('markdown')) {
         $class = str_replace('DummyView', $this->option('markdown'), $class);
     }
     return $class;
 }
开发者ID:jarnovanleeuwen,项目名称:framework,代码行数:14,代码来源:NotificationMakeCommand.php

示例9: buildClass

 /**
  * @param string $name
  *
  * @return string
  */
 protected function buildClass($name)
 {
     $stub = parent::buildClass($name);
     $table = Str::plural(Str::snake(class_basename($this->argument('name'))));
     $this->table = str_replace('._', '_', $table);
     $stub = str_replace('DummyTable', $this->table, $stub);
     return $stub;
 }
开发者ID:vampirekiss,项目名称:lumen-restful-starter-kit,代码行数:13,代码来源:ModelMakeCommand.php

示例10: buildClass

 /**
  * Build the class with the given name.
  *
  * Remove the base controller import if we are already in base namespace.
  *
  * @param  string  $name
  * @return string
  */
 protected function buildClass($name)
 {
     $this->info('<info>Created Controller:</info> ' . $name);
     $namespace = $this->getNamespace($name);
     $class = str_replace("use {$namespace}\\Controller;\n", '', parent::buildClass($name));
     $class = str_replace('{{modelName}}', $this->option('model'), $class);
     return str_replace('{{view}}', $this->option('view'), $class);
 }
开发者ID:aiddroid,项目名称:laravel-curd-generator,代码行数:16,代码来源:MakeCurdControllerCommand.php

示例11: buildClass

 protected function buildClass($name)
 {
     $stub = parent::buildClass($name);
     $repository = config('repository.base_repository', Repository::class);
     $this->replaceRepository($stub, $repository);
     $this->replaceModel($stub);
     return $stub;
 }
开发者ID:znck,项目名称:repository,代码行数:8,代码来源:RepositoryMakeCommand.php

示例12: 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

示例13: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     parent::fire();
     if (!$this->option('no-migration')) {
         $table = str_plural(snake_case(class_basename($this->argument('name'))));
         $this->call('make:migration', ['name' => "create_{$table}_table", '--create' => $table]);
     }
 }
开发者ID:HarveyCheng,项目名称:myblog,代码行数:13,代码来源:ModelMakeCommand.php

示例14: buildClass

 /**
  * Build the class with the given name.
  *
  * @param  string  $name
  * @return string
  */
 protected function buildClass($name)
 {
     $fqModelClass = $this->parseModelName($this->argument('name'));
     $stub = parent::buildClass($name);
     $stub = str_replace('{FQModelClass}', $fqModelClass, $stub);
     $stub = str_replace('{Listener}', class_basename($name), $stub);
     return $stub;
 }
开发者ID:elodex,项目名称:elodex,代码行数:14,代码来源:MakeSyncHandler.php

示例15: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     if (parent::fire() !== false) {
         if ($this->option('migration')) {
             $table = Str::plural(Str::snake(class_basename($this->argument('name'))));
             $this->call('make:migration', ['name' => "create_{$table}_table", '--create' => $table]);
         }
     }
 }
开发者ID:manhvu1212,项目名称:videoplatform,代码行数:14,代码来源:ModelMakeCommand.php


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