Home/Controller/UserController.class.php
<?php
namespace HomeController;
use ThinkController;
use ThinkModel;
class UserController extends Controller{
public function index(){
}
public function model(){
$user = D('User');
var_dump($user->getDbFields());
}
}
Home/Conf/config.php
<?php
return array(
//'配置项'=>'配置值'
'DB_TYPE'=>'mysql',
'DB_HOST'=>'127.0.0.1',
'DB_NAME'=>'thinkphp',
'DB_USER'=>'root',
'DB_PWD'=>'',
'DB_PORT'=>3306,
'DB_PREFIX'=>'Think_',
'DB_CHARSET'=>'utf8',
);
显示:http://localhost/demo3/Home/User/model