PHP code example of selfim / data_dictionary
1. Go to this page and download the library: Download selfim/data_dictionary library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
selfim / data_dictionary example snippets
use DictionaryExport\DataDict;
//默认为Markdown格式
DataDict::init(['dbname'=>'your database','host'=>'your host','user'=>'username','password'=>'password'])
->make();
//导出word
DataDict::init(['dbname'=>'your database','host'=>'your host','user'=>'username','password'=>'password'])
->make('doc');
//导出excel
DataDict::init(['dbname'=>'your database','host'=>'your host','user'=>'username','password'=>'password'])
->make('xls');
//输出为html
DataDict::init(['dbname'=>'your database','host'=>'your host','user'=>'username','password'=>'password'])
->make('html');
//浏览器输出pdf
DataDict::init(['dbname'=>'your database','host'=>'your host','user'=>'username','password'=>'password'])
->make('pdf');
//导出单个表
DataDict::init(['dbname'=>'your database','host'=>'your host','user'=>'username','password'=>'password'])
->setExportTable('tablename')
->make('html');
//导出指定表
DataDict::init(['dbname'=>'your database','host'=>'your host','user'=>'username','password'=>'password'])
->setExportTables(['tablename','tablename1'])
->make('html');