ThinkPHP Extension
ThinkPHP extension., (*1)
Component List:
- Log Driver for Database, (*2)
Log Driver for Database
Usage Steps:
1. New a migrate.
2. New a model (optional)., (*3)
New a migrate:
``` php
class CreateLogTable extends \McDanci\ThinkPHP\database\migrates\CreateLogTable
{
}, (*4)
---
New a model:
``` php
namespace app\common\model;
class Log extends \McDanci\ThinkPHP\app\common\model\Log
{}
Call:
``` php
use think\Log;, (*5)
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);
```, (*6)
Note
Front-end web resources for ThinkPHP is recommended to be located in the path of ./public/static
according to the root of project., (*7)