TbHtml::htmlButton PHP Method

htmlButton() public static method

Generates an image submit button.
public static htmlButton ( string $label = 'Button', array $htmlOptions = [] ) : string
$label string
$htmlOptions array additional HTML attributes.
return string the generated button.
    public static function htmlButton($label = 'Button', $htmlOptions = array())
    {
        return self::btn(self::BUTTON_TYPE_HTML, $label, $htmlOptions);
    }

Usage Example

Example #1
0
 public function testHtmlButton()
 {
     $I = $this->codeGuy;
     $html = TbHtml::htmlButton('Button', array('class' => 'button', 'name' => 'button'));
     $button = $I->createNode($html, 'button[type=button].btn');
     $I->seeNodeCssClass($button, 'button');
     $I->seeNodeAttribute($button, 'name', 'button');
     $I->seeNodeText($button, 'Button');
 }
TbHtml