if?(strtolower($postObj->MsgType)?==?'text'?&&?trim($postObj->Content)?==?'圖文')?{
$arr?=?array(
array(
'title'?=>?'hello?world!',
'description'?=>?'百度一下,你就知道',
'picurl'?=>?'https://www.baidu.com/img/bdlogo.png',
'url'?=>?'https://www.baidu.com'
),
array(
'title'?=>?'優酷',
'description'?=>?'這世界很酷',
'picurl'?=>?'https://www.baidu.com/img/bdlogo.png',
'url'?=>?'https://www.youku.com'
),
);
$indexModel?=?new?IndexModel;
$indexModel->responseNews($postObj,$arr);
}else{
//如果用戶發送文本信息
switch($postObj->Content)?{
case?'hi':
$content?=?'你好?。?;
break;
case?'日期':
$content?=?"你好!現在是\n".date("Y年m月d日?H點i分s秒");
break;
default:
$content?=?"您可以嘗試輸入?hi、今天日期、圖文";
break;
}
$indexModel?=?new?IndexModel;
$indexModel->responseText($postObj,$content);
????}
2017-11-08
在IndexController.class.php中,用new的方法調用 ?Model文件夾中建立的IndexModel.class.php中的?responseNews($postObj,$arr),不成功啊。是不是在哪里還要配置??TP3.2.3的Controller里調用默認指向本項目中的Model文件夾嗎?? ?搞了好幾天,都沒搞定
2017-11-08
同問,我也很困惑。
2017-02-25