This is a demo for CodeIgniter HTMX helper library. Demo requires:
composer create-project codeigniter4/appstarter codeigniterhtmx
cd codeigniterhtmx
composer require michalsn/codeigniter-htmx
Manually download ZIP file of this project and place it in the desired folder.
codeigniterhtmx/app/ThirdParty/htmx-demo
. codeigniterhtmx/app/Config/Autoload.php
file and adding the Michalsn\CodeIgniterHtmxDemo
namespace to the $psr4
array, like in the below example:<?php
// ...
public $psr4 = [
APP_NAMESPACE => APPPATH, // For custom app namespace
'Config' => APPPATH . 'Config',
'Michalsn\CodeIgniterHtmxDemo' => APPPATH . 'ThirdParty/htmx-demo/src',
];
// ...
First, make sure to create a database for the project. You can name it codeigniterhtmx
and set credentials for the database connection in codeigniterhtmx/app/Config/Database.php
, see framework's user guide for more information.
Before running the examples you have to migrate the database. Make sure you have set correct credentials to the database and then run the command:
php spark migrate --all
And preferably run the seeds:
For Unix:
php spark db:seed Michalsn\\CodeIgniterHtmxDemo\\Database\\Seeds\\SeedDemo
For Windows:
php spark db:seed Michalsn\CodeIgniterHtmxDemo\Database\Seeds\SeedDemo
The default route to the demo page is demo
.