thinkphp
thinkphp copied to clipboard
ThinkPHP3.2 ——基于PHP5的简单快速的面向对象的PHP框架
用正则路由匹配类似/app/aaa.bbb.ccc的url时,只能匹配到aaa.bbb
Hello, I am trying to enable CROSS domains but i am not able to do this. how i can enable cross for controllers. Thanks
当模型类设置了protected $fields = array(字段,'_pk'=>'user_id'), $key = $this->getPk();主键值不正确。 Model.class.php 137行 和 143行,肿么个意思。
如果用一下这种方式连接数据库,DB_CONFIG2 为配置中数据库连接(数组格式) ``` 'DB_CONFIG2' => array( 'db_type' => 'mysql', 'db_user' => 'root', 'db_pwd' => '1234', 'db_host' => 'localhost', 'db_port' => '3306', 'db_name' => 'thinkphp', 'db_charset'=> 'utf8', ) $User = M('User','other_','DB_CONFIG2');...
原事务方法不支持如下写法 ``` M()->startTrans(); M()->startTrans();//这里会提交事务 M()->rollback();//这行以下的事务全部无效 M()->commit(); M()->commit(); ``` 原因是 `Model::startTrans()` 方法会自动执行一次 `commit` ,这样会导致上面嵌套写法的事务在中间被强制提交 ,而之后的 `commit` 以及 `rollback` 全部无效,主要是rollback的失效会导致严重的问题。 改进想法: `M()->startTrans();` 不自动提交,这样只会 `transTimes+1` ,然后 commit 和 rollback 都检测 `transTimes == 1`...
当使用_query 方式作为where条件时,parse_str 对小数点转换导致使用alias()方法 具体例子 ``` '_query' => 'goodsCatId1=442&goodsCatId2=442&goodsCatId3=442&_logic=or', ``` 当使用alias后 ``` '_query' => 'g.goodsCatId1=442&g.goodsCatId2=442&g.goodsCatId3=442&_logic=or', ``` 通过parse_str方法会被转换`.`为`_` ``` SELECT g.goodsId,g.goodsName,g.shopPrice,g.goodsThums,g.goodsUnit FROM tc_goods g WHERE g.goodsStatus = 1 AND g.goodsTag IN (0,1,2,3)...
Hello, I found out a mistake which is when using php funciton "in_array" to search the global static variable! It like this: First, define a array: `$example_array = array('Index' =>...
modify setDriver error variable name