Alertas
extends BaseController
in package
Class BaseController
BaseController provides a convenient place for loading components and performing functions that are needed by all your controllers. Extend this class in any new controllers: class Home extends BaseController
For security be sure to declare any new methods as protected or private.
Table of Contents
- $apiazimut : mixed
- $forceHTTPS : int
- Should enforce HTTPS access for all methods in this controller.
- $helpers : array<string|int, mixed>
- Helpers that will be automatically loaded on class instantiation.
- $logger : LoggerInterface
- Instance of logger to use.
- $mysqli : mixed
- $request : RequestInterface
- Instance of the main Request object.
- $response : ResponseInterface
- Instance of the main response object.
- $validator : Validation
- Once validation has been run, will hold the Validation instance.
- __construct() : mixed
- En la función __construct() se verifica que rol tiene asignado la cuenta de usuario que entra, dependiendo del rol la vista será diferente.
- create() : mixed
- En la función create() se utilizan uno o varios modelos para conseguir los datos necesarios en función del rol, si es necesario, y llevar al usuario al formulario
- delete() : mixed
- En la función delete() se eliminan los datos, buscando la entrada correcta a través del ID.
- edit() : mixed
- En la función edit() se utilizan uno o varios modelos para conseguir los datos necesarios en función del rol para poder mostrar los datos en el formulario de actualización de la entrada. Además se busca la entrada correcta en base a su ID.
- index() : mixed
- En la función index() se utiliza para mostrar las vistas, se utiliza un modelo que tiene como tabla una vista mysql, luego se comprueba que rol tiene y se muestra la vista correspondiente.
- initController() : mixed
- Constructor.
- store() : mixed
- En la función store() se insertan los datos introducidos en el formulario a través de un modelo de datos en la base de datos.
- update() : mixed
- En la función update() se actualizan los datos introducidos a través del formulario, buscando la entrada correcta a través del ID.
- cachePage() : mixed
- Provides a simple way to tie into the main CodeIgniter class and tell it how long to cache the current page for.
- forceHTTPS() : mixed
- A convenience method to use when you need to ensure that a single method is reached only via HTTPS. If it isn't, then a redirect will happen back to this method and HSTS header will be sent to have modern browsers transform requests automatically.
- loadHelpers() : mixed
- Handles "auto-loading" helper files.
- validate() : bool
- A shortcut to performing validation on input data. If validation is not successful, a $errors property will be set on this class.
Properties
$apiazimut
protected
mixed
$apiazimut
$forceHTTPS
Should enforce HTTPS access for all methods in this controller.
protected
int
$forceHTTPS
= 0
Number of seconds to set HSTS header
$helpers
Helpers that will be automatically loaded on class instantiation.
protected
array<string|int, mixed>
$helpers
= []
$logger
Instance of logger to use.
protected
LoggerInterface
$logger
$mysqli
protected
mixed
$mysqli
$request
Instance of the main Request object.
protected
RequestInterface
$request
$response
Instance of the main response object.
protected
ResponseInterface
$response
$validator
Once validation has been run, will hold the Validation instance.
protected
Validation
$validator
Methods
__construct()
En la función __construct() se verifica que rol tiene asignado la cuenta de usuario que entra, dependiendo del rol la vista será diferente.
public
__construct() : mixed
Return values
mixed —create()
En la función create() se utilizan uno o varios modelos para conseguir los datos necesarios en función del rol, si es necesario, y llevar al usuario al formulario
public
create() : mixed
Return values
mixed —delete()
En la función delete() se eliminan los datos, buscando la entrada correcta a través del ID.
public
delete(mixed $alerta_id) : mixed
Parameters
- $alerta_id : mixed
Return values
mixed —edit()
En la función edit() se utilizan uno o varios modelos para conseguir los datos necesarios en función del rol para poder mostrar los datos en el formulario de actualización de la entrada. Además se busca la entrada correcta en base a su ID.
public
edit(mixed $alerta_id) : mixed
Parameters
- $alerta_id : mixed
Return values
mixed —index()
En la función index() se utiliza para mostrar las vistas, se utiliza un modelo que tiene como tabla una vista mysql, luego se comprueba que rol tiene y se muestra la vista correspondiente.
public
index() : mixed
Return values
mixed —initController()
Constructor.
public
initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) : mixed
Parameters
- $request : RequestInterface
- $response : ResponseInterface
- $logger : LoggerInterface
Tags
Return values
mixed —store()
En la función store() se insertan los datos introducidos en el formulario a través de un modelo de datos en la base de datos.
public
store() : mixed
Return values
mixed —update()
En la función update() se actualizan los datos introducidos a través del formulario, buscando la entrada correcta a través del ID.
public
update(mixed $alerta_id) : mixed
Parameters
- $alerta_id : mixed
Return values
mixed —cachePage()
Provides a simple way to tie into the main CodeIgniter class and tell it how long to cache the current page for.
protected
cachePage(int $time) : mixed
Parameters
- $time : int
Return values
mixed —forceHTTPS()
A convenience method to use when you need to ensure that a single method is reached only via HTTPS. If it isn't, then a redirect will happen back to this method and HSTS header will be sent to have modern browsers transform requests automatically.
protected
forceHTTPS([int $duration = 31536000 ]) : mixed
Parameters
- $duration : int = 31536000
-
The number of seconds this link should be considered secure for. Only with HSTS header. Default value is 1 year.
Tags
Return values
mixed —loadHelpers()
Handles "auto-loading" helper files.
protected
loadHelpers() : mixed
Tags
Return values
mixed —validate()
A shortcut to performing validation on input data. If validation is not successful, a $errors property will be set on this class.
protected
validate(array<string|int, mixed>|string $rules[, array<string|int, mixed> $messages = [] ]) : bool
Parameters
- $rules : array<string|int, mixed>|string
- $messages : array<string|int, mixed> = []
-
An array of custom error messages