码迷,mamicode.com
首页 > 其他好文 > 详细

每天laravel-20160725| Genaerator command-2

时间:2016-04-27 07:03:40      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:larvael

/**
 * Get the stub file for the generator.
 *
 * @return string
 */
abstract protected function getStub();//Get the stub file for the generator

/**
 * Execute the console command.
 *
 * @return bool|null
 */
public function fire()//Execute the console command
{
    $name = $this->parseName($this->getNameInput());// $name use a function to parse it and use a function to get Input name

    $path = $this->getPath($name);// from the name get path ,

    if ($this->alreadyExists($this->getNameInput())) {// if know the name
        $this->error($this->type.‘ already exists!‘);

        return false;
    }// tell the false messages

    $this->makeDirectory($path);// make dir

    $this->files->put($path, $this->buildClass($name));// put file to the path

    $this->info($this->type.‘ created successfully.‘);// write log.
}


本文出自 “专注php” 博客,请务必保留此出处http://jingshanls.blog.51cto.com/3357095/1768070

每天laravel-20160725| Genaerator command-2

标签:larvael

原文地址:http://jingshanls.blog.51cto.com/3357095/1768070

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!