{{fields}}
AJAX端
$.ajax({
type:'get',
url:'index.php?m={{m}}&c={{c}}&a={{a}}',
dataType:'JSON',
data:'is_api=1'{{each items1 as value index }}&{{value.item_val}}='+$('#{{value.item_val}}').val()+'{{/each}},
success:function(res){
if(res.code==1){
}
}
})
PHP端
//请求文件地址
/phpcms/modules/{{m}}/{{c}}.php
public function {{a}}(){
{{each items1 as value index }}$data['{{value.item_val}}']=$_GET['{{value.item_val}}'];
{{/each}}
{{each items1 as value index }}{{if value.item_type=="是"}}if(empty($data['{{value.item_val}}'])){
$this->api_return_json(array('msg'=>'{{value.item_desc}}不能为空!'),0);
}
{{/if}}{{/each}}
$this->api_return_json(array('msg'=>'操作成功'),1);
}