How to set data for components on server side? From models or database and etc. #18
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hi, thank you for your question! So, let's make one thing clear: Viewi is essentially your front-end application written in PHP. Therefore it acts pretty much the same as it would be written in Vue or Angular. Those frameworks use HttpClient (Angular) or fetch (Vue) to get the data. By using it, you can get any data you want from a server. It will act like AJAX in the browser, and will invoke API endpoint directly on the server during SSR. I hope this answers your question. And I will gladly assist you if you need any help, just let me know. |
Beta Was this translation helpful? Give feedback.
Hi, thank you for your question!
So, let's make one thing clear: Viewi is essentially your front-end application written in PHP. Therefore it acts pretty much the same as it would be written in Vue or Angular. Those frameworks use HttpClient (Angular) or fetch (Vue) to get the data.
Same goes here, Viewi has HttpClient on board:
HttpClient in Viewi
By using it, you can get any data you want from a server. It will act like AJAX in the browser, and will invoke API endpoint directly on the server during SSR.
I hope this answers your question. And I will gladly assist you if you need any help, just let me know.