Yii 开发过程 tips

 1、 查看DAO 生成的sql 结果(类似TP的 getLastSql):

    $reto  = $edb->createCommand($bsql);
    echo $reto->text;

2、Yii获取客户端IP

Yii::app()->request->userHostAddress;

3、获取iframe元素

    var iframe = document.getElementsByName("goods_list")[0];
    iframe.onload = iframe.onreadystatechange = function() {
        $(iframe.contentWindow.document.getElementsByTagName('html')[0]).find('#list_table input[type=checkbox]').click(function(){
            console.dir($(this).val());
        });
    }

4、https域名下curl验证网址:

        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);          //网站不需要证书认证
        //curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,true); ;         //需要
        //curl_setopt($ch,'http://m.jiangzaixing.com/cacert.pem'); 

5、thinkphp isnll  is not null 判断

'user_id'=>array('exp','is null'),
原文地址:https://www.cnblogs.com/glory-jzx/p/3520069.html