echo $a->$route();
или $content = $a->$route();
// а где-то дальше echo $content;
getEntity(entity) {
return fetch(this.url + `${entity}`).then(response => {
return response.json();
});
}
// const people = characters.map(elem => {
// console.log(elem);
// });
let requests = characters.map(url => fetch(url));
Promise.all(requests)
.then(responses => Promise.all(responses.map(r => r.json())))
.then(characters => console.info(characters));