tp6 编写速记

  • 内容
  • 评论
  • 相关

安装

composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

composer create-project topthink/think tp

命令行创建api(多应用模式需要删除默认应用才可生效)

php think make:controller Bio@Api --api

命令行创建model

composer require topthink/think-orm (首次)

php think make:model Bio/Taxa

对应url

http://xxx.com/index.php/Bio/api/方法名/参数/x

效果

使用sqllite

根目录.env

[DATABASE]
TYPE = sqlite
HOSTNAME = 127.0.0.1
DATABASE = "/www/wwwroot/xxx/xxx.db"
USERNAME = username
PASSWORD = password
HOSTPORT = 3306
CHARSET = utf8
DEBUG = true

评论

0条评论

发表评论

电子邮件地址不会被公开。