[WIP] Codeigniter 4 and Vue SPA (Vue Cli) |
A little tutorial. Work in progress.
1. Installing CodeIgniter 4 composer create-project codeigniter4/appstarter example --no-dev 2. Installing Vue in the CodeIgniter directory cd example vue create frontend --no-git 3. Move all files from example/public to example/frontend/public 4. Create a vue.config.js in the frontend directory Code: // vue.config.js - target is the url from the test server - indexPath and outputDir // after "npm run build" the build script move the example/frontend/public/index.html to example/app/Views/index.php and The example/frontend/public/ directory to the example/public directory. Warning: The npm run build delete the example/public directory and recreate it. 5. example Code. PHP Code: /** example/app/Controllers/Api/Test.php PHP Code: <?php namespace App\Controllers\Api; Catch-all Controller. PHP Code: <?php namespace App\Controllers; example/frontend/src/views/Home.vue Code: <template> |
Messages In This Thread |
[WIP] Codeigniter 4 and Vue SPA (Vue Cli) - by Paradinight - 06-12-2020, 02:03 AM
RE: [WIP] Codeigniter 4 and Vue SPA (Vue Cli) - by mike437 - 08-30-2020, 06:53 PM
RE: [WIP] Codeigniter 4 and Vue SPA (Vue Cli) - by yabdab - 09-29-2020, 12:27 PM
|