Home » vue » Display data with php or js? [duplicate]

Display data with php or js? [duplicate]

Posted by: admin November 26, 2021 Leave a comment

Questions:

I’m learning vue.js now on laracasts.com and there jeffrey way shows 2 way to display data on web page.
One is to display data from Laravel foreach and second is to display data with vue.js. I have one question:
is there any difference by performance to display data with Laravel or display data with vue.js?

Answers:

As for preformance you can take a look of this question:

But using Javascript to display data, you have less coupler between Controller and View layers. That way if your Views get more complexity this independence can help you a lot or if you want to make your page more dynamic using AJAX. Theres others options in frontend like Angular.js and Ember.js make you to use MVC in your View layer. The other hand if your view is basic you can use PHP.