Reputation: 25
I have build an app with vue (not with vue cli). I ran It on my local host. What I am trying to do is to add php in this Project. But I cannot run php and vue on the same local host together. Is there a way to solve this problem ?
I know when the app is created with command line interface you can compile them with webpack. But how to combine back-end and front-end together when the app is created with vue?
Thanks a lot in advance
Upvotes: 2
Views: 3141
Reputation: 2254
Vue is a javascript framework and I suppose you are familiar with javascript. In javascript, we use AJAX to interact with PHP. we used to send POST and GET request to the server via ajax and javascript and we get the response from the server.
In a similar way, you need to learn how to create Rest API for GET and POST via vueJS and PHP.
You Need to create Rest API for VueJS and PHP. There is no other solution. follow the links below as per your need.
Upvotes: 2