PHP code example of zwei / base
1. Go to this page and download the library: Download zwei/base 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/ */
zwei / base example snippets
use \Zwei\Base\Config;
// 读取默认配置"config\bao-loan.yml"
Config::get("配置键名");
// 读取配置文件"config/test-new-prefix.conf.yml"中的"test-new-prefix-key"
Config::get('test-new-prefix-key', 'test-new-prefix', 'test-new-prefix.conf.yml');
# 获取doctrine数据库连接
// 返回\Doctrine\DBAL\Connection类,请查看doctrine 官网文档
$dbConnection = DB::getInstance()->getConnection();