您的位置:首页 > 编程语言 > PHP开发

THINKPHP学习

2016-04-02 19:12 501 查看
$autoReply = D('AutoReply');
$autoReply->select();
使用字符串查询
$con = 'appid="'.$this->getAppID()."\"";
使用数值查询
//          $constant=1
//          $con = 'id='.$constant;
查询
//$result = $autoReply->where($con)->select();
删除
$result = $autoReply->where($con)->delete();
插入
$insert_data = $_GET["ret"];
\Think\Log::record(__METHOD__." ".__LINE__." ".gettype($insert_data),'ERR');


PATHINFO模式

{$ruleItemData["keywords"][$i].keyword} 模板中使用变量

<if condition="$ruleItemData['keywords'][$i]['matchMode'] eq '0'">

<for start="0" end ="$ruleItemData.keywordsCount" >

Smarty模板

vendor 供应方、插件

模板中使用自定义函数: 应用目录下有Common目录,在此目录下的Common目录建立function.php

无法加载控制器:home,

'MODULE_ALLOW_LIST' => array('Home','Admin'),

define('BIND_MODULE','WeChat');
define('BUILD_CONTROLLER_LIST','Index,User,Menu');

这些代码只在项目开始的时候使用,后面就不用了

should be compatible 的错误处理

打开 Think\Model\MongoModel.class.php
找到 setInc($field,$step=1) 257行,修改为 setInc($field, $step = 1, $lazyTime = 0),
找到 setDec($field,$step=1) 268行,修改为 setDec($field, $step = 1, $lazyTime = 0) 。
打开 Think\Db\Driver\Mongo.class.php
找到 connect($config='',$linkNum=0) 48行,修改为 connect($config = '', $linkNum = 0, $autoConnection = false),
找到 insertAll($dataList,$options=array()) 229行,修改为insertAll($dataList, $options = array(), $replace = false)。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: