Клиентская
<script>
$.ajax({
type: 'POST',
url: '/api/getlisteat',
chache: false
});
</script>
Серверная:
public function actionGetlisteat()
{
$file = json_decode(
file_get_contents('../use_config/config.json'), true)['eat'];
return json_encode($file);
}
actionGetlisteat
->actionPostlisteat
||type: 'POST'
->type: 'GET'