S
S
suhuxa12017-07-19 13:35:09
Laravel
suhuxa1, 2017-07-19 13:35:09

Return view via ajax with additional parameters. How (laravel)?

Good afternoon!
See what's the problem. By clicking the "more" button, you need to load articles. The controller loads the necessary articles from the database and returns a view with the articles. Everything is great! But I also need to pass different parameters. For example, how much news is now displayed, and the status is success or false. How can I do it? Before. when I returned data in json format, everything was fine (but then the articles were not returned from the view, but were generated in the controller itself).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
cha-cha, 2017-07-19
@suhuxa1

return response()->json([
    'params' => [...],
    'view' => '...'
]);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question