ThinkPHP extension.
Component List:
- Log Driver for Database
Usage Steps:
- New a migrate.
- 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);
Front-end web resources for ThinkPHP is recommended to be located in the path of ./public/static
according to the root of project.