Files
CSiCoDB2/app/Controllers/Categorie.php
T
2026-05-06 11:04:41 +02:00

58 lines
1.6 KiB
PHP

<?php namespace App\Controllers;
use App\Libraries\Crud;
class Categorie extends CRUDController {
// Tab: Categorie = ['caIDcategoria', 'caCode', 'caNome', 'caDescrizione'];
protected $crud;
function __construct() {
$params = [
'table' => 'Categorie',
'dev' => false,
'fields' => $this->field_options(),
'form_title_add' => 'Add Categoria',
'form_title_update' => 'Edit Categoria',
'form_submit' => 'Add',
'table_title' => 'Pagina per la tabella Categorie',
'form_submit_update' => 'Update',
'base' => '',
'UpdatedAt' => '',
'DeletedAt' => '',
];
$this->crud = new Crud($params, service('request'));
}// __construct
protected function field_options() {
$fields = [];
$fields['caIDcategoria'] = ['label' => 'ID', 'helper' => 'Identificativo univoco del record nel database'];
$fields['caCode'] = ['label' => 'Code', 'helper' => 'Codice della categoria (2 caratteri)', 'required' => true];
$fields['caNome'] = ['label' => 'Nome', 'helper' => 'Nome della categoria (max 32 caratteri)', 'required' => true];
$fields['caDescrizione'] = ['label' => 'Descrizione', 'helper' => 'Descrizione esaustiva della categoria','required' => true];
return $fields;
}// field_options
public function index() { return $this->CRUD_view(['caIDcategoria', 'caCode', 'caNome', 'caDescrizione']); }
//--------------------------------------------------------------------
// Auto CRUD terminato
//--------------------------------------------------------------------
}