https://github.com/mcdanci/thnkphp-ext
ThinkPHP extension.
https://github.com/mcdanci/thnkphp-ext
php php5 php7 php71 thinkphp thinkphp-php thinkphp5
Last synced: 4 months ago
JSON representation
ThinkPHP extension.
- Host: GitHub
- URL: https://github.com/mcdanci/thnkphp-ext
- Owner: mcdanci
- License: apache-2.0
- Created: 2018-03-14T06:40:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-23T01:14:41.000Z (over 7 years ago)
- Last Synced: 2025-01-30T05:26:33.264Z (5 months ago)
- Topics: php, php5, php7, php71, thinkphp, thinkphp-php, thinkphp5
- Language: PHP
- Size: 19.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: docs/CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: docs/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# ThinkPHP Extension
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:
``` php
class CreateLogTable extends \McDanci\ThinkPHP\database\migrates\CreateLogTable
{
}
```---
New a model:
``` php
namespace app\common\model;class Log extends \McDanci\ThinkPHP\app\common\model\Log
{}
```---
Call:
``` php
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.