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