Files
safekat/ci4/app/Controllers/Tarifas/Acabados/ServiciosAcabado.php

68 lines
2.3 KiB
PHP

<?php
namespace App\Controllers\Tarifas\Acabados;
use App\Controllers\BaseResourceController;
use App\Entities\Tarifas\Acabados\ServicioAcabadoEntity;
use App\Models\Collection;
use App\Models\Tarifas\Acabados\ServiciosAcabadoModel;
class TarifaAcabados extends BaseResourceController
{
protected $modelName = ServicioAcabadoEntity::class;
protected $format = 'json';
protected static $singularObjectName = 'Servicio Acabado';
protected static $singularObjectNameCc = 'servicioAcabado';
protected static $pluralObjectName = 'Servicios Acabado';
protected static $pluralObjectNameCc = 'serviciosAcabado';
protected static $controllerSlug = 'serviciosacabado';
protected static $viewPath = 'themes/vuexy/form/tarifas/acabado/';
protected $indexRoute = 'servicioAcabadoList';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
$this->viewData['pageTitle'] = lang('Servicioacabado.moduleTitle');
$this->viewData['usingSweetAlert'] = true;
// Se indica que este controlador trabaja con soft_delete
$this->soft_delete = true;
// Se indica el flag para los ficheros borrados
$this->delete_flag = 1;
$this->viewData = ['usingServerSideDataTable' => true];
// Breadcrumbs
$this->viewData['breadcrumb'] = [
['title' => lang("App.menu_tarifas"), 'route' => "javascript:void(0);", 'active' => false],
['title' => lang("App.menu_Servicioacabado"), 'route' => site_url('tarifas/acabados'), 'active' => true]
];
parent::initController($request, $response, $logger);
}
public function index()
{
checkPermission('tarifa-acabado.menu');
$viewData = [
'currentModule' => static::$controllerSlug,
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Servicioacabado.serviciosacabado')]),
'servicioacabadoEntity' => new ServicioAcabadoEntity(),
'usingServerSideDataTable' => true,
];
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
return view(static::$viewPath . 'viewServicioAcabadoList', $viewData);
}
}