DaoFramework是一个Web应用程序框架。
cofig
配置文件位于applicatio\cofig文件夹下
<?php$cofig = [ 'ame' => 'DaoFramework', 'dafault' => 'idex/idex', 'db' => [ 'driver' => 'mysql', 'choose' => 'local', 'database' => '17za', 'prefix' => '', 'local' => require 'db_local.php', 'product' => require 'db_local.php', ], 'redis' => [ ], 'defiitio' => require 'defiitio.php', 'route' => require 'route.php',];cotroller
控制器文件存放applicatio\cotroller文件夹
<?phpamespace App\Cotrollers;use Dao\Core\Dao;use Dao\Core\Cotroller;class Idex exteds Cotroller { public fuctio idex() { }}获取$cofig中变量的值可以这样写Dao::$app->cofig['ame']
Database
数据库操作暂时没有ORM映射功能,支持链式操作,暂不支持直接SQL查目前还缺少很多功能,会不断优化调整
$where = [ 'id'=>':id', 'or'=>[ 'betwee'=>['id',':id2',':id3'] ], 'ad'=>[ '>'=>['id',10] '<'=>['id',100] ] 'like' => ['ame',':title']];支持各种无聊写法,并不完善
$data = Dao::$app->db() ->select('*') ->from('test_tets') ->where($where) ->bid([':id'=>1,':id2'=>10,':id3'=>14,':title'=>'%50%']) ->limit(1,10) ->order('id desc') ->exec() ->asArray(); //Dao::$app->db()->isert('test_tets',['id'=>14,'ame'=>'哈哈哈哈w'])->exec(); Dao::$app->db()->update('test_tets',['ame'=>'哈哈哈哈www'])->where(['id'=>14])->exec(); Dao::$app->db()->delete('test_tets')->where('id=13')->exec();View
文件位于 applicatio\views文件夹 目前支持原始语法 暂不支持模板语言,支持简单布局









评论