-
Notifications
You must be signed in to change notification settings - Fork 11
Button
VMBindraban edited this page Mar 4, 2013
·
5 revisions
The SxBootstap button view helper shows a button made with the twitter bootstrap. The following syntax builds the button. It is possible to chain types.
<?php
// available parameters: string, array, object
echo $this->sxbButton('Click me!');
?>
<?php
$options = array(
'name' => 'buttonName',
'id' => 'buttonID',
'data-loading-text' => 'Loading..',
'data-toggle' => 'button',
);
echo $this->sxbButton($options));
?>
<?php
$button = new \Zend\Form\Element\Button('buttonLabel');
$button->setLabel('sxbButton');
echo $this->sxbButton($button);
?>
<?php
$buttonSubmit = new \Zend\Form\Element\Submit('submitButtonLabel');
echo $this->sxbButton($buttonSubmit);
?>
<?php
// info, danger, warning, success, inverse, primary, link, disabled, mini, small, large, block,
echo $this->sxbButton('Click me!')->info();
echo $this->sxbButton('Click me!')->success()->small()->disabled();
?>
<?php
// loadingText, toggle
echo $this->sxbButton('Click me!')->toggle('button');
echo $this->sxbButton('Click me!')->loadingText('Loading...');
?>
<?php
// setLabel, addClass, addAttribute
echo $this->sxbButton()->setLabel('Click me!');
echo $this->sxbButton('Click me!')->addClass('ButtonClass');
echo $this->sxbButton('Click me!')->addAttribute('key', 'value');
?>