WidgetInfo
extends WidgetInfo
in package
Class created by Core/Internal/PluginsDeploy
Table of Contents
Constants
- ALERT_BTN_CLASS = ['primary' => 'btn-primary', 'secondary' => 'btn-secondary', 'success' => 'btn-success', 'danger' => 'btn-danger', 'warning' => 'btn-warning', 'info' => 'btn-info', 'light' => 'btn-secondary', 'dark' => 'btn-light']
- Clase de botón recomendada según la documentación de Bootstrap 5 para cada tipo de alerta.
- ALERT_TYPES = ['primary', 'secondary', 'success', 'danger', 'warning', 'info', 'light', 'dark']
Properties
- $autocomplete : bool
- $class : string
- $fieldclick : mixed
- $fieldname : string
- $icon : string
- $id : string
- Identifies the object with a defined name in the view
- $name : string
- Name defined in the view as key
- $onclick : string
- $options : array<string|int, mixed>
- $readonly : string
- $required : bool
- $tabindex : int
- $alert : string
- $btnClass : string
- $btnText : string
- $href : string
- $template : string
- $text : string
- $uniqueId : int
- $value : mixed
- $valueOnClick : mixed
Methods
- __construct() : mixed
- edit() : string
- Renderiza el widget en modo edición (formulario).
- getColorFromOption() : string
- Calculate color from option configuration
- getLevel() : int
- getToken() : string
- getType() : string
- Get the widget type
- gridFormat() : array<string|int, mixed>
- inputHidden() : string
- No genera input oculto (el widget no tiene campo de modelo).
- plainText() : string
- Muestra el texto traducido en texto plano.
- processFormData() : void
- No procesa datos de formulario (widget de solo visualización).
- setCustomValue() : mixed
- Set custom fixed value to widget
- setLevel() : mixed
- setToken() : mixed
- showTableTotals() : bool
- tableCell() : string
- Renderiza el widget en la celda de una tabla.
- applyOperatorFromOption() : bool
- assets() : mixed
- Adds assets to the asset manager.
- buildAlertHtml() : string
- Construye el HTML de una alerta Bootstrap 5.
- buildContent() : string
- Construye el HTML completo del contenido del widget.
- buildLinkHtml() : string
- Construye el HTML del botón de enlace.
- buildPlainHtml() : string
- Construye el HTML sin alerta (texto simple con icono y enlace opcionales).
- colorToClass() : string
- combineClasses() : string
- css() : string
- Returns equivalent css class to $class. To extend in plugins.
- getUniqueId() : int
- inputHtml() : string
- inputHtmlExtraParams() : string
- loadOptions() : void
- onclickHtml() : string
- readonly() : bool
- renderTemplate() : string
- Renderiza una vista Twig personalizada pasando el modelo como variable.
- setValue() : void
- Sin campo de modelo vinculado, no hay valor que establecer.
- show() : string
- tableCellClass() : string
Constants
ALERT_BTN_CLASS
Clase de botón recomendada según la documentación de Bootstrap 5 para cada tipo de alerta.
public
array<string|int, string>
ALERT_BTN_CLASS
= ['primary' => 'btn-primary', 'secondary' => 'btn-secondary', 'success' => 'btn-success', 'danger' => 'btn-danger', 'warning' => 'btn-warning', 'info' => 'btn-info', 'light' => 'btn-secondary', 'dark' => 'btn-light']
ALERT_TYPES
public
array<string|int, string>
ALERT_TYPES
= ['primary', 'secondary', 'success', 'danger', 'warning', 'info', 'light', 'dark']
Tipos de alerta Bootstrap 5 válidos
Properties
$autocomplete
public
bool
$autocomplete
$class
public
string
$class
$fieldclick
public
mixed
$fieldclick
$fieldname
public
string
$fieldname
$icon
public
string
$icon
$id
Identifies the object with a defined name in the view
public
string
$id
$name
Name defined in the view as key
public
string
$name
$onclick
public
string
$onclick
$options
public
array<string|int, mixed>
$options
= []
$readonly
public
string
$readonly
$required
public
bool
$required
$tabindex
public
int
$tabindex
$alert
protected
string
$alert
Tipo de alerta Bootstrap 5
$btnClass
protected
string
$btnClass
Clase CSS del botón de enlace
$btnText
protected
string
$btnText
Texto del botón de enlace (traducible)
$href
protected
string
$href
URL del enlace
$template
protected
string
$template
Ruta a una vista Twig personalizada (sin extensión .html.twig)
$text
protected
string
$text
Texto informativo principal (traducible con Tools::trans())
$uniqueId
protected
static int
$uniqueId
= -1
$value
protected
mixed
$value
$valueOnClick
protected
mixed
$valueOnClick
= null
Methods
__construct()
public
__construct(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
edit()
Renderiza el widget en modo edición (formulario).
public
edit(object $model[, string $title = '' ][, string $description = '' ][, string $titleurl = '' ]) : string
Parameters
- $model : object
- $title : string = ''
- $description : string = ''
- $titleurl : string = ''
Return values
stringgetColorFromOption()
Calculate color from option configuration
public
getColorFromOption(array<string|int, string> $option, mixed $value, string $prefix) : string
Parameters
- $option : array<string|int, string>
- $value : mixed
- $prefix : string
Return values
stringgetLevel()
public
static getLevel() : int
Return values
intgetToken()
public
static getToken() : string
Return values
stringgetType()
Get the widget type
public
getType() : string
Return values
stringgridFormat()
public
gridFormat() : array<string|int, mixed>
Return values
array<string|int, mixed>inputHidden()
No genera input oculto (el widget no tiene campo de modelo).
public
inputHidden(object $model) : string
Parameters
- $model : object
Return values
stringplainText()
Muestra el texto traducido en texto plano.
public
plainText(object $model) : string
Parameters
- $model : object
Return values
stringprocessFormData()
No procesa datos de formulario (widget de solo visualización).
public
processFormData(object &$model, Request $request) : void
Parameters
- $model : object
- $request : Request
setCustomValue()
Set custom fixed value to widget
public
setCustomValue(mixed $value) : mixed
Parameters
- $value : mixed
setLevel()
public
static setLevel(int $new) : mixed
Parameters
- $new : int
setToken()
public
static setToken(string $token) : mixed
Parameters
- $token : string
showTableTotals()
public
showTableTotals() : bool
Return values
booltableCell()
Renderiza el widget en la celda de una tabla.
public
tableCell(object $model[, string $display = 'left' ]) : string
Parameters
- $model : object
- $display : string = 'left'
Return values
stringapplyOperatorFromOption()
protected
applyOperatorFromOption(array<string|int, string> $option, mixed $value) : bool
Parameters
- $option : array<string|int, string>
- $value : mixed
Return values
boolassets()
Adds assets to the asset manager.
protected
assets() : mixed
buildAlertHtml()
Construye el HTML de una alerta Bootstrap 5.
protected
buildAlertHtml(string $iconHtml, string $text, string $linkHtml) : string
Parameters
- $iconHtml : string
- $text : string
- $linkHtml : string
Return values
stringbuildContent()
Construye el HTML completo del contenido del widget.
protected
buildContent() : string
Return values
stringbuildLinkHtml()
Construye el HTML del botón de enlace.
protected
buildLinkHtml() : string
Return values
stringbuildPlainHtml()
Construye el HTML sin alerta (texto simple con icono y enlace opcionales).
protected
buildPlainHtml(string $iconHtml, string $text, string $linkHtml) : string
Parameters
- $iconHtml : string
- $text : string
- $linkHtml : string
Return values
stringcolorToClass()
protected
colorToClass(string $color, string $prefix) : string
Parameters
- $color : string
- $prefix : string
Return values
stringcombineClasses()
protected
combineClasses(array<string|int, mixed> ...$classes) : string
Parameters
- $classes : array<string|int, mixed>
Return values
stringcss()
Returns equivalent css class to $class. To extend in plugins.
protected
css(string $class) : string
Parameters
- $class : string
Return values
stringgetUniqueId()
protected
getUniqueId() : int
Return values
intinputHtml()
protected
inputHtml([string $type = 'text' ][, string $extraClass = '' ]) : string
Parameters
- $type : string = 'text'
- $extraClass : string = ''
Return values
stringinputHtmlExtraParams()
protected
inputHtmlExtraParams() : string
Return values
stringloadOptions()
protected
loadOptions(array<string|int, mixed> $children) : void
Parameters
- $children : array<string|int, mixed>
onclickHtml()
protected
onclickHtml(string $inside[, string $titleurl = '' ]) : string
Parameters
- $inside : string
- $titleurl : string = ''
Return values
stringreadonly()
protected
readonly() : bool
Return values
boolrenderTemplate()
Renderiza una vista Twig personalizada pasando el modelo como variable.
protected
renderTemplate(object $model) : string
Parameters
- $model : object
Return values
stringsetValue()
Sin campo de modelo vinculado, no hay valor que establecer.
protected
setValue(object $model) : void
Parameters
- $model : object
show()
protected
show() : string
Return values
stringtableCellClass()
protected
tableCellClass([string $initialClass = '' ][, string $alternativeClass = '' ]) : string
Parameters
- $initialClass : string = ''
- $alternativeClass : string = ''