老师,我这里有几句关于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']);
}
}
帮我注释一下每一句表达的是什么意思,谢谢