.. Copyright (C) 2010-2021 Combodo SARL .. http://opensource.org/licenses/AGPL-3.0 .. _Button: Button ====== Class Button ---- .. include:: /manual/Component/Button/ButtonAdditionalDescription.rst ---- Twig Tag -------- :Tag: **UIButton** :Syntax: .. code-block:: twig {% UIButton Type {Parameters} %} :Type: +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Neutral ` | Make a basis Button component for any purpose | +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`ForPrimaryAction ` | Make a Button component for a primary action, should be used to tell the user this is the main choice | +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`ForSecondaryAction ` | Make a Button component for a secondary action, should be used to tell the user this is an second hand choice | +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`ForPositiveAction ` | Make a Button component for a success action, should be used to tell the user he/she going to make a positive action/choice | +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`ForDestructiveAction ` | Make a Button component for a destructive action, should be used to tell the user he/she going to make something that cannot be | +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`AlternativeNeutral ` | Make a basis Button component for any purpose | +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`ForAlternativePrimaryAction ` | Make a Button component for an alternative primary action, should be used to avoid the user to consider this action as the first | +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`ForAlternativeSecondaryAction ` | Make a Button component for an alternative secondary action, should be used to avoid the user to focus on this | +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`ForAlternativeValidationAction ` | Make a Button component for a validation action, should be used to avoid the user to focus on this | +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`ForAlternativeDestructiveAction ` | Make a Button component for a destructive action, should be used to avoid the user to focus on this | +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`ForCancel ` | Make a Button component for a cancel, should be used only for UI navigation, not destructive action | +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`IconAction ` | @param string $sIconClasses | +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`LinkNeutral ` | Make a link Button component to open an URL instead of triggering a form action | +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`IconLink ` | @param string $sIconClasses | +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | :ref:`DestructiveIconLink ` | @param string $sIconClasses | +--------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ .. _ButtonNeutral: Button Neutral ^^^^^^^^^^^^^^ :syntax: .. code-block:: twig {% UIButton Neutral {sLabel:'value', sName:'value', sId:'value'} %} :parameters: +--------+--------+-----------+------+----------------------------+ | sLabel | string | mandatory | | | +--------+--------+-----------+------+----------------------------+ | sName | string | optional | NULL | See {@link Button::$sName} | +--------+--------+-----------+------+----------------------------+ | sId | string | optional | NULL | | +--------+--------+-----------+------+----------------------------+ .. _ButtonForPrimaryAction: Button ForPrimaryAction ^^^^^^^^^^^^^^^^^^^^^^^ :syntax: .. code-block:: twig {% UIButton ForPrimaryAction {sLabel:'value', sName:'value', sValue:'value', bIsSubmit:true, sId:'value'} %} :parameters: +-----------+--------+-----------+-------+---------------------+ | sLabel | string | mandatory | | | +-----------+--------+-----------+-------+---------------------+ | sName | string | optional | NULL | See Button::$sName | +-----------+--------+-----------+-------+---------------------+ | sValue | string | optional | NULL | See Button::$sValue | +-----------+--------+-----------+-------+---------------------+ | bIsSubmit | bool | optional | false | See Button::$sType | +-----------+--------+-----------+-------+---------------------+ | sId | string | optional | NULL | | +-----------+--------+-----------+-------+---------------------+ .. _ButtonForSecondaryAction: Button ForSecondaryAction ^^^^^^^^^^^^^^^^^^^^^^^^^ :syntax: .. code-block:: twig {% UIButton ForSecondaryAction {sLabel:'value', sName:'value', sValue:'value', bIsSubmit:true, sId:'value'} %} :parameters: +-----------+--------+-----------+-------+---------------------+ | sLabel | string | mandatory | | | +-----------+--------+-----------+-------+---------------------+ | sName | string | optional | NULL | See Button::$sName | +-----------+--------+-----------+-------+---------------------+ | sValue | string | optional | NULL | See Button::$sValue | +-----------+--------+-----------+-------+---------------------+ | bIsSubmit | bool | optional | false | See Button::$sType | +-----------+--------+-----------+-------+---------------------+ | sId | string | optional | NULL | | +-----------+--------+-----------+-------+---------------------+ .. _ButtonForPositiveAction: Button ForPositiveAction ^^^^^^^^^^^^^^^^^^^^^^^^ :syntax: .. code-block:: twig {% UIButton ForPositiveAction {sLabel:'value', sName:'value', sValue:'value', bIsSubmit:true, sId:'value'} %} :parameters: +-----------+--------+-----------+-------+---------------------+ | sLabel | string | mandatory | | | +-----------+--------+-----------+-------+---------------------+ | sName | string | optional | NULL | See Button::$sName | +-----------+--------+-----------+-------+---------------------+ | sValue | string | optional | NULL | See Button::$sValue | +-----------+--------+-----------+-------+---------------------+ | bIsSubmit | bool | optional | false | See Button::$sType | +-----------+--------+-----------+-------+---------------------+ | sId | string | optional | NULL | | +-----------+--------+-----------+-------+---------------------+ .. _ButtonForDestructiveAction: Button ForDestructiveAction ^^^^^^^^^^^^^^^^^^^^^^^^^^^ :syntax: .. code-block:: twig {% UIButton ForDestructiveAction {sLabel:'value', sName:'value', sValue:'value', bIsSubmit:true, sId:'value'} %} :parameters: +-----------+--------+-----------+-------+---------------------+ | sLabel | string | mandatory | | | +-----------+--------+-----------+-------+---------------------+ | sName | string | optional | NULL | See Button::$sName | +-----------+--------+-----------+-------+---------------------+ | sValue | string | optional | NULL | See Button::$sValue | +-----------+--------+-----------+-------+---------------------+ | bIsSubmit | bool | optional | false | See Button::$sType | +-----------+--------+-----------+-------+---------------------+ | sId | string | optional | NULL | | +-----------+--------+-----------+-------+---------------------+ .. _ButtonAlternativeNeutral: Button AlternativeNeutral ^^^^^^^^^^^^^^^^^^^^^^^^^ :syntax: .. code-block:: twig {% UIButton AlternativeNeutral {sLabel:'value', sName:'value', sValue:'value', bIsSubmit:true, sId:'value'} %} :parameters: +-----------+--------+-----------+-------+---------------------+ | sLabel | string | mandatory | | | +-----------+--------+-----------+-------+---------------------+ | sName | string | optional | NULL | See Button::$sName | +-----------+--------+-----------+-------+---------------------+ | sValue | string | optional | NULL | See Button::$sValue | +-----------+--------+-----------+-------+---------------------+ | bIsSubmit | bool | optional | false | See Button::$sType | +-----------+--------+-----------+-------+---------------------+ | sId | string | optional | NULL | | +-----------+--------+-----------+-------+---------------------+ .. _ButtonForAlternativePrimaryAction: Button ForAlternativePrimaryAction ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :syntax: .. code-block:: twig {% UIButton ForAlternativePrimaryAction {sLabel:'value', sName:'value', sValue:'value', bIsSubmit:true, sId:'value'} %} :parameters: +-----------+--------+-----------+-------+---------------------+ | sLabel | string | mandatory | | | +-----------+--------+-----------+-------+---------------------+ | sName | string | optional | NULL | See Button::$sName | +-----------+--------+-----------+-------+---------------------+ | sValue | string | optional | NULL | See Button::$sValue | +-----------+--------+-----------+-------+---------------------+ | bIsSubmit | bool | optional | false | See Button::$sType | +-----------+--------+-----------+-------+---------------------+ | sId | string | optional | NULL | | +-----------+--------+-----------+-------+---------------------+ .. _ButtonForAlternativeSecondaryAction: Button ForAlternativeSecondaryAction ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :syntax: .. code-block:: twig {% UIButton ForAlternativeSecondaryAction {sLabel:'value', sName:'value', sValue:'value', bIsSubmit:true, sId:'value'} %} :parameters: +-----------+--------+-----------+-------+---------------------+ | sLabel | string | mandatory | | | +-----------+--------+-----------+-------+---------------------+ | sName | string | optional | NULL | See Button::$sName | +-----------+--------+-----------+-------+---------------------+ | sValue | string | optional | NULL | See Button::$sValue | +-----------+--------+-----------+-------+---------------------+ | bIsSubmit | bool | optional | false | See Button::$sType | +-----------+--------+-----------+-------+---------------------+ | sId | string | optional | NULL | | +-----------+--------+-----------+-------+---------------------+ .. _ButtonForAlternativeValidationAction: Button ForAlternativeValidationAction ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :syntax: .. code-block:: twig {% UIButton ForAlternativeValidationAction {sLabel:'value', sName:'value', sValue:'value', bIsSubmit:true, sId:'value'} %} :parameters: +-----------+--------+-----------+-------+---------------------+ | sLabel | string | mandatory | | | +-----------+--------+-----------+-------+---------------------+ | sName | string | optional | NULL | See Button::$sName | +-----------+--------+-----------+-------+---------------------+ | sValue | string | optional | NULL | See Button::$sValue | +-----------+--------+-----------+-------+---------------------+ | bIsSubmit | bool | optional | false | See Button::$sType | +-----------+--------+-----------+-------+---------------------+ | sId | string | optional | NULL | | +-----------+--------+-----------+-------+---------------------+ .. _ButtonForAlternativeDestructiveAction: Button ForAlternativeDestructiveAction ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :syntax: .. code-block:: twig {% UIButton ForAlternativeDestructiveAction {sLabel:'value', sName:'value', sValue:'value', bIsSubmit:true, sId:'value'} %} :parameters: +-----------+--------+-----------+-------+---------------------+ | sLabel | string | mandatory | | | +-----------+--------+-----------+-------+---------------------+ | sName | string | optional | NULL | See Button::$sName | +-----------+--------+-----------+-------+---------------------+ | sValue | string | optional | NULL | See Button::$sValue | +-----------+--------+-----------+-------+---------------------+ | bIsSubmit | bool | optional | false | See Button::$sType | +-----------+--------+-----------+-------+---------------------+ | sId | string | optional | NULL | | +-----------+--------+-----------+-------+---------------------+ .. _ButtonForCancel: Button ForCancel ^^^^^^^^^^^^^^^^ :syntax: .. code-block:: twig {% UIButton ForCancel {sLabel:'value', sName:'value', sValue:'value', bIsSubmit:true, sId:'value'} %} :parameters: +-----------+--------+----------+-------+---------------------+ | sLabel | string | optional | NULL | | +-----------+--------+----------+-------+---------------------+ | sName | string | optional | NULL | See Button::$sName | +-----------+--------+----------+-------+---------------------+ | sValue | string | optional | NULL | See Button::$sValue | +-----------+--------+----------+-------+---------------------+ | bIsSubmit | bool | optional | false | See Button::$sType | +-----------+--------+----------+-------+---------------------+ | sId | string | optional | NULL | | +-----------+--------+----------+-------+---------------------+ .. _ButtonIconAction: Button IconAction ^^^^^^^^^^^^^^^^^ :syntax: .. code-block:: twig {% UIButton IconAction {sIconClasses:'value', sTooltipText:'value', sName:'value', sValue:'value', bIsSubmit:true, sId:'value'} %} :parameters: +--------------+--------+-----------+-------+--+ | sIconClasses | string | mandatory | | | +--------------+--------+-----------+-------+--+ | sTooltipText | string | optional | '' | | +--------------+--------+-----------+-------+--+ | sName | string | optional | NULL | | +--------------+--------+-----------+-------+--+ | sValue | string | optional | NULL | | +--------------+--------+-----------+-------+--+ | bIsSubmit | bool | optional | false | | +--------------+--------+-----------+-------+--+ | sId | string | optional | NULL | | +--------------+--------+-----------+-------+--+ .. _ButtonLinkNeutral: Button LinkNeutral ^^^^^^^^^^^^^^^^^^ :syntax: .. code-block:: twig {% UIButton LinkNeutral {sURL:'value', sLabel:'value', sIconClasses:'value', sTarget:'value', sId:'value'} %} :parameters: +--------------+--------+-----------+------+--+ | sURL | string | mandatory | | | +--------------+--------+-----------+------+--+ | sLabel | string | optional | '' | | +--------------+--------+-----------+------+--+ | sIconClasses | string | optional | NULL | | +--------------+--------+-----------+------+--+ | sTarget | string | optional | NULL | | +--------------+--------+-----------+------+--+ | sId | string | optional | NULL | | +--------------+--------+-----------+------+--+ .. _ButtonIconLink: Button IconLink ^^^^^^^^^^^^^^^ :syntax: .. code-block:: twig {% UIButton IconLink {sIconClasses:'value', sTooltipText:'value', sURL:'value', sTarget:'value', sId:'value'} %} :parameters: +--------------+--------+-----------+------+--+ | sIconClasses | string | mandatory | | | +--------------+--------+-----------+------+--+ | sTooltipText | string | mandatory | | | +--------------+--------+-----------+------+--+ | sURL | string | optional | '' | | +--------------+--------+-----------+------+--+ | sTarget | string | optional | NULL | | +--------------+--------+-----------+------+--+ | sId | string | optional | NULL | | +--------------+--------+-----------+------+--+ .. _ButtonDestructiveIconLink: Button DestructiveIconLink ^^^^^^^^^^^^^^^^^^^^^^^^^^ :syntax: .. code-block:: twig {% UIButton DestructiveIconLink {sIconClasses:'value', sTooltipText:'value', sURL:'value', sName:'value', sTarget:'value', sId:'value'} %} :parameters: +--------------+--------+-----------+------+--+ | sIconClasses | string | mandatory | | | +--------------+--------+-----------+------+--+ | sTooltipText | string | mandatory | | | +--------------+--------+-----------+------+--+ | sURL | string | optional | NULL | | +--------------+--------+-----------+------+--+ | sName | string | optional | NULL | | +--------------+--------+-----------+------+--+ | sTarget | string | optional | NULL | | +--------------+--------+-----------+------+--+ | sId | string | optional | NULL | | +--------------+--------+-----------+------+--+ Button common parameters ^^^^^^^^^^^^^^^^^^^^^^^^ +-----------------------------+--------+------------------------------------------------------------+ | ActionType | string | | +-----------------------------+--------+------------------------------------------------------------+ | AddCSSClass | string | CSS class to add to the generated html block | +-----------------------------+--------+------------------------------------------------------------+ | AddCSSClasses | array | like ['ibo-is-hidden', 'ibo-alert--body'] | +-----------------------------+--------+------------------------------------------------------------+ | AddCssFileRelPath | string | | +-----------------------------+--------+------------------------------------------------------------+ | AddHtml | string | | +-----------------------------+--------+------------------------------------------------------------+ | AddJsFileRelPath | string | | +-----------------------------+--------+------------------------------------------------------------+ | AddMultipleCssFilesRelPaths | array | | +-----------------------------+--------+------------------------------------------------------------+ | AddMultipleJsFilesRelPaths | array | | +-----------------------------+--------+------------------------------------------------------------+ | CSSClasses | array | like ['ibo-is-hidden', 'ibo-alert--body'] | +-----------------------------+--------+------------------------------------------------------------+ | Color | string | | +-----------------------------+--------+------------------------------------------------------------+ | DataAttributes | array | Array of data attributes in the format ['name' => 'value'] | +-----------------------------+--------+------------------------------------------------------------+ | IconClass | string | | +-----------------------------+--------+------------------------------------------------------------+ | IsDisabled | bool | | +-----------------------------+--------+------------------------------------------------------------+ | IsHidden | bool | Indicates if the block is hidden by default | +-----------------------------+--------+------------------------------------------------------------+ | JsCode | string | | +-----------------------------+--------+------------------------------------------------------------+ | Label | string | | +-----------------------------+--------+------------------------------------------------------------+ | OnClickJsCode | string | | +-----------------------------+--------+------------------------------------------------------------+ | Tooltip | string | | +-----------------------------+--------+------------------------------------------------------------+ ---- .. include:: /manual/Component/Button/ButtonFooter.rst