Validate.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: 刘志淳 <chun@engineer.com>
  10. // +----------------------------------------------------------------------
  11. namespace think\console\command\make;
  12. use think\console\command\Make;
  13. class Validate extends Make
  14. {
  15. protected $type = "Validate";
  16. protected function configure()
  17. {
  18. parent::configure();
  19. $this->setName('make:validate')
  20. ->setDescription('Create a validate class');
  21. }
  22. protected function getStub()
  23. {
  24. $stubPath = __DIR__ . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR;
  25. return $stubPath . 'validate.stub';
  26. }
  27. protected function getNamespace($appNamespace, $module)
  28. {
  29. return parent::getNamespace($appNamespace, $module) . '\validate';
  30. }
  31. }