template updates - htmx on categories form
This commit is contained in:
30
templates/element/ProductCategories/form.php
Normal file
30
templates/element/ProductCategories/form.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $productCategory
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $productCatalogs
|
||||
* @var string|null $prefix
|
||||
*/
|
||||
|
||||
echo $this->Form->control('product_catalog_id', [
|
||||
'options' => $productCatalogs,
|
||||
'hx-trigger' => 'change, load delay:1s',
|
||||
'hx-get' => $this->Url->build([
|
||||
'plugin' => 'CakeProducts',
|
||||
'controller' => 'ProductCategories',
|
||||
'action' => 'select',
|
||||
'?' => [
|
||||
'category_id' => $productCategory->parent_id ?? '',
|
||||
],
|
||||
]),
|
||||
'hx-target' => '#product_category_parent_id',
|
||||
]);
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('category_description');
|
||||
echo $this->Form->control('parent_id', [
|
||||
'options' => $parentProductCategories,
|
||||
'empty' => true,
|
||||
'id' => 'product_category_parent_id',
|
||||
]);
|
||||
echo $this->Form->control('enabled');
|
||||
?>
|
||||
Reference in New Issue
Block a user