mcdanci/thinkphp-ext

ThinkPHP (版本 5.0) 标准扩展。

dev-master 2018-03-22 09:32 UTC

This package is not auto-updated.

Last update: 2024-09-29 05:35:00 UTC


README

ThinkPHP 扩展。

组件列表

  • 数据库日志驱动

数据库日志驱动

使用步骤

  1. 创建一个迁移。
  2. 创建一个模型(可选)。

创建一个迁移

class CreateLogTable extends \McDanci\ThinkPHP\database\migrates\CreateLogTable
{
}

创建一个模型

namespace app\common\model;

class Log extends \McDanci\ThinkPHP\app\common\model\Log
{}

调用

use think\Log;

Log::init(['type' => '\McDanci\ThinkPHP\Driver\Log\DB']);
Log::record('String', Log::LOG);
Log::record(['String too'], Log::LOG);
Log::record(['String with extra', 'Extra information'], Log::LOG);

注意

建议将 ThinkPHP 的前端资源放在项目根目录下的 ./public/static 路径中。