1. Go to this page and download the library: Download nkondrashov/yii3-htmx library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nkondrashov / yii3-htmx example snippets
->middleware(HTMXMiddleware::class)
$assetManager->register(HTMXAsset::class);
$tag = Yiisoft\Html\Html::button('[ X ]']);
$htmx = HTMX::make($tag)
->request(Yiisoft\Http\Method::DELETE, '/item/delete/' . $todo->id)
->setSwap('none')
->runOnClick();
if (!$todo->is_complete) {
$htmx->addConfirm('Are you sure?');
}
echo $htmx;