gtflixtv/active-record

该包最新版本(dev-master)的许可信息不可用。

Yii 2 活动记录

安装: 8

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

公开问题: 1

类型:项目

dev-master 2019-01-28 20:49 UTC

This package is auto-updated.

Last update: 2024-09-13 21:27:56 UTC


README

配置数据库连接

\ActiveRecord\db\Bootstrap::configure($host, $base, $user, $password);

用法

https://yiiframework.cn/doc-2.0/guide-db-active-record.html

AR 生成器

创建一个包含以下代码的 ./bin/ar PHP 脚本:

// Ensure that the \ActiveRecord\db\Bootstrap::configure is called somewhere in bootstrap
include_once '../bootstrap.php';


$tables          = 'database_name:table1,table2';

$generator = new \ActiveGenerator\generator\ScriptHelper();
$generator->path = dirname(__DIR__) . '/src/Model';
$generator->prefix = 'Base';
$generator->generate($db->getSlavePdo(), $tables);

$tables 变量替换为您自己的表列表。

此脚本将生成以下文件结构: