This is a simple project to experiment with using Vue.js in the frontend and PHP in the backend.
The goal of this project is to test if you can load Vue directly in PHP and access PHP-generated JSON data without needing JavaScript fetch
calls. Instead, the data is passed directly into Vue.
- PHP Backend: PHP generates JSON data and makes it available via a global set config variable.
- Vue Frontend: Vue consumes that data without using
fetch
or external APIs.
-
Clone the repo:
git clone https://github.com/Lukevdb01/vue-with-php.git cd vue-with-php
-
Start the PHP server by using this command: (or clone the repo in htdocs folder of XAMPP)
php -S localhost:8000
-
Open
http://localhost:8000
in your browser.