Ease Framework Twitter Bootstrap 4 Support
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

40 lines
1.1 KiB

<?php
namespace Ease\TWB4;
/**
* Odkazové tlačítko twbootstrabu.
*
* @author Vítězslav Dvořák <vitex@hippy.cz>
* @copyright 2012-2017 Vitex@vitexsoftware.cz (G)
*
* @link http://twitter.github.com/bootstrap/base-css.html#buttons Buttons
*/
class LinkButton extends \Ease\Html\ATag
{
/**
* Odkazové tlačítko twbootstrabu.
*
* @param string $href cíl odkazu
* @param mixed $contents obsah tlačítka
* @param string $type primary|info|success|warning|danger|inverse|link
* @param array $properties dodatečné vlastnosti
*/
public function __construct($href, $contents = null, $type = null,
$properties = [])
{
if (isset($properties['class'])) {
$class = ' '.$properties['class'];
} else {
$class = '';
}
if (is_null($type)) {
$properties['class'] = 'btn btn-default';
} else {
$properties['class'] = 'btn btn-'.$type;
}
$properties['class'] .= $class;
parent::__construct($href, $contents, $properties);
}
}