老師,我這里有幾句關(guān)于API的代碼,能幫我注釋下每個語句是什么意思嗎?
<?php
namespace Home\c;
use FrPHP\lib\Controller;
use FrPHP\Extend\Page;
use FrPHP\Extend\ArrayPage;
class ApiController extends CommonController
{
?? public function index(){
????? ??? ?$tid = $this->frparam('id');
????? ??? ?if(?? ?$tid==""){
????? ??? ????? JsonReturn(['code'=>1,'msg'=>'指定欄目不能為空!']);
????? ??? ????? exit;
????? ??? ?}
????? ??? ?$res = M('article')->findAll(array('tid'=>$tid,'molds'=>'article'));
??????? $num= count($res);
??????? JsonReturn(['code'=>0,'data'=>$res,'sum'=>$num,'msg'=>'success']);
?? }
}
幫我注釋一下每一句表達的是什么意思,謝謝
2022-06-01
就是一個類,導(dǎo)出成功的判斷關(guān)系