mcdanci/thinkphp-ext

ThinkPHP (version 5.0) standard extension.

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

This package is not auto-updated.

Last update: 2024-05-12 03:38:20 UTC


README

ThinkPHP extension.

Component List:

  • Log Driver for Database

Log Driver for Database

Usage Steps:

  1. New a migrate.
  2. New a model (optional).

New a migrate:

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

New a model:

namespace app\common\model;

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

Call:

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);

Note

Front-end web resources for ThinkPHP is recommended to be located in the path of ./public/static according to the root of project.