Welcome Guest, Not a member yet? Register   Sign In
CI 4/Alpinejs/htmx/vitejs
#1

Hello team,

I'm working on a tool developed with Codeigniter 4, alpinjs, htmx, Tailwindcss and vitejs.
I have a Core module that integrates the BO, with notifications, Forms, Storage, images, Job, etc, ...
I started with a npm installation for everything that is alpinejs, htmx and others, all compiled with vitejs.
I have 4 modules at the moment, Invoices/Quotes, Clients, Media, and Front.
So far so good with cell_view() It's great with hx-boot.

Small problem since yesterday on my client module, I want to add a "calendar" entry with an Alpinejs insertion.
The script is between


PHP Code:
<?php $this->section('scripts'?>
document.addEventListener("alpine:init", () => {
        Alpine.data("calendar", () => ({})
})
<?php $this->endSection(); ?>


And it doesn't work.
It works if I put it directly in the "master.php" layout file

I'm making a comparison with laravel and its @push which has to restart Alpine start on each insertion, no?

Can you do the same with Codeigniter 4?

Thanks guys
Reply


Messages In This Thread
CI 4/Alpinejs/htmx/vitejs - by FabriceL - 11-15-2023, 05:01 AM
RE: CI 4/Alpinejs/htmx/vitejs - by luckmoshy - 11-15-2023, 08:18 AM
RE: CI 4/Alpinejs/htmx/vitejs - by FabriceL - 11-15-2023, 10:14 AM
RE: CI 4/Alpinejs/htmx/vitejs - by dgvirtual - 11-29-2024, 02:37 PM



Theme © iAndrew 2016 - Forum software by © MyBB