PHP code example of liuqiandev / thinkphp-facade-generator

1. Go to this page and download the library: Download liuqiandev/thinkphp-facade-generator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

liuqiandev / thinkphp-facade-generator example snippets


thinkphp 5.1.*

php >= 7.1.0

return [
    //你的其他命令行
    'make:appFacade'=>\liuqiandev\thinkphp_facade_generator\AppFacade::class,
];

php think make:appFacade 指定类的完整命名空间
    //可选参数
    --path self 




namespace app\common\service;


class User
{
    /**
     * @desc 获取指定field的用户信息
     * @user Liu qian
     * @time 2020/3/18 22:15
     * @param string $field
     * @return int
     */
    public function getField(string $field)
    {
        return 1;
    }

    /**
     * @desc 设置查询用户的UID
     * @user Liu qian
     * @time 2020/3/18 22:15
     * @param int $uid
     * @return $this
     */
    public function setUid(int $uid):self
    {
        return $this;
    }

}

php think make:appFacade app\common\service\User