TbHtml::linkButton PHP Method

linkButton() public static method

Generates a link submit button.
public static linkButton ( string $label = 'Submit', array $htmlOptions = [] ) : string
$label string the button label.
$htmlOptions array additional HTML attributes.
return string the generated button tag.
    public static function linkButton($label = 'Submit', $htmlOptions = array())
    {
        return self::btn(self::BUTTON_TYPE_LINK, $label, $htmlOptions);
    }

Usage Example

 /**
  * Renders the form buttons
  */
 protected function renderButtons()
 {
     echo TbHtml::submitButton(Yii::t('FilterForm', 'Apply filter'), array('color' => TbHtml::BUTTON_COLOR_PRIMARY));
     $controller = Yii::app()->controller;
     // Disable when no filter is defined
     echo TbHtml::linkButton(Yii::t('FilterForm', 'Clear filter'), array('color' => TbHtml::BUTTON_COLOR_INFO, 'disabled' => $this->model->isEmpty(), 'url' => $controller->createUrl($controller->route)));
 }
All Usage Examples Of TbHtml::linkButton
TbHtml