Getting to know the html helper
Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus.
<?php echo TbHtml::lead('...'); ?>
This line of text is meant to be treated as fine print.
<p><?php echo TbHtml::small('...'); ?></p>
The following snippet of text is rendered as bold text.
<p>The following snippet of text is <?php echo TbHtml::b('rendered as bold text'); ?>.</p>
The following snippet of text is rendered as italic text.
<p>The following snippet of text is <?php echo TbHtml::i('rendered as italic text'); ?>.</p>
Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.
Etiam porta sem malesuada magna mollis euismod.
Donec ullamcorper nulla non metus auctor fringilla.
Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
<?php echo TbHtml::muted('Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.'); ?> <?php echo TbHtml::em('Etiam porta sem malesuada magna mollis euismod.', array('color' => TbHtml::TEXT_COLOR_WARNING)); ?> <?php echo TbHtml::em('Donec ullamcorper nulla non metus auctor fringilla.', array('color' => TbHtml::TEXT_COLOR_ERROR)); ?> <?php echo TbHtml::em('Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis.', array('color' => TbHtml::TEXT_COLOR_INFO)); ?> <?php echo TbHtml::em('Duis mollis, est non commodo luctus, nisi erat porttitor ligula.', array('color' => TbHtml::TEXT_COLOR_SUCCESS)); ?>
An abbreviation of the word attribute is <?php echo TbHtml::abbr('attr', 'attribute'); ?>.
<?php echo TbHtml::smallAbbr('HTML', 'HyperText Markup Language'); ?> is the best thing since sliced bread.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
<?php echo TbHtml::quote('...'); ?>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
Someone famous in Source Title
<?php echo TbHtml::quote('...', array( 'source' => 'Someone famous in', 'cite' => 'Source Title', )); ?>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
Someone famous in Source Title
<?php echo TbHtml::quote('...', array( 'source' => 'Someone famous in', 'cite' => 'Source Title', 'pull' => TbHtml::PULL_RIGHT, )); ?>
<section>
should be wrapped as inline.
For example, <?php echo TbHtml::code('<section>'); ?> should be wrapped as inline.
<p>Sample text here...</p>
<?php echo TbHtml::codeBlock('<p>Sample text here...</p>'); ?>
<?php echo TbHtml::beginFormTb(); ?> <fieldset> <legend>Legend</legend> <?php echo TbHtml::label('Label name', 'text'); ?> <?php echo TbHtml::textField('text', '', array('placeholder' => 'Type something...')); ?> <?php echo TbHtml::checkBox('checkMeOut', false, array('label' => 'Check me out')); ?> <?php echo TbHtml::submitButton('Submit'); ?> </fieldset> <?php echo TbHtml::endForm(); ?>
<?php echo TbHtml::beginFormTb(TbHtml::FORM_LAYOUT_SEARCH); ?> <?php echo TbHtml::searchQuery('search'); ?> <?php echo TbHtml::submitButton('Submit'); ?> <?php echo TbHtml::endForm(); ?>
<?php echo TbHtml::beginFormTb(TbHtml::FORM_LAYOUT_INLINE); ?> <?php echo TbHtml::textField('email', '', array('placeholder' => 'Email', 'size' => TbHtml::INPUT_SIZE_SMALL)); ?> <?php echo TbHtml::passwordField('password', '', array('placeholder' => 'Password', 'size' => TbHtml::INPUT_SIZE_SMALL)); ?> <?php echo TbHtml::checkBox('rememberMe', false, array('label' => 'Remember me')); ?> <?php echo TbHtml::submitButton('Sign in'); ?> <?php echo TbHtml::endForm(); ?>
<?php echo TbHtml::beginFormTb(TbHtml::FORM_LAYOUT_HORIZONTAL); ?> <?php echo TbHtml::emailFieldControlGroup('email', '', array('label' => 'Email', 'placeholder' => 'Email')); ?> <?php echo TbHtml::passwordFieldControlGroup('password', '', array('label' => 'Password', 'placeholder' => 'Password')); ?> <?php echo TbHtml::checkBoxControlGroup('rememberMe', false, array( 'label' => 'Remember me', 'controlOptions' => array('after' => TbHtml::submitButton('Sign in')), )); ?> <?php echo TbHtml::endForm(); ?>
<?php echo TbHtml::textField('text', '', array('placeholder' => 'Text input')); ?>
<?php echo TbHtml::textArea('text', '', array('rows' => 3)); ?>
<?php echo TbHtml::checkBox('checkBox', '', array('label' => 'Option one is this and that—be sure to include why it\'s great')); ?> <?php echo TbHtml::radioButtonList('optionsRadios', '', array( 'option1' => 'Option one is this and that—be sure to include why it\'s great', 'option2' => 'Option two can be something else and selecting it will deselect option one', )); ?>
<?php echo TbHtml::inlineCheckBoxList('inlineCheckbox', '', array( 'option1' => '1', 'option2' => '2', 'option3' => '3', )); ?>
<?php echo TbHtml::dropDownList('dropDown', '', array('1', '2', '3', '4', '5')); ?> <?php echo TbHtml::dropDownList('dropDown', '', array('1', '2', '3', '4', '5'), array('multiple' => true)); ?>
<?php echo TbHtml::textField('prependedInput', '', array('placeholder' => 'Username', 'prepend' => '@', 'span' => 2)); ?> <?php echo TbHtml::textField('appendedInput', '', array('append' => '.00', 'span' => 2)); ?>
<?php echo TbHtml::textField('appendedPrependedInput', '', array('prepend' => '$', 'append' => '.00', 'span' => 2)); ?>
<?php echo TbHtml::textField('appendedInputButton', '', array('append' => TbHtml::button('Go!'), 'span' => 2)); ?>
<?php echo TbHtml::textField('appendedInputButtons', '', array('append' => TbHtml::button('Search') . ' ' . TbHtml::button('Options'), 'span' => 2)); ?>
<?php echo TbHtml::textField('appendedDropdownButton', '', array('append' => TbHtml::buttonDropdown('Action', array(...)), 'span' => 2)); ?>
<?php echo TbHtml::textField('prependedDropdownButton', '', array('prepend' => TbHtml::buttonDropdown('Action', array(...)), 'span' => 2)); ?>
<?php echo TbHtml::textField('appendedPrependedDropdownButton', '', array( 'prepend' => TbHtml::buttonDropdown('Action', array(...)), 'append' => TbHtml::buttonDropdown('Action', array(..)), 'span' => 2, )); ?>
<?php echo TbHtml::textField('prependedSplitDropdownButton', '', array('prepend' => TbHtml::splitButtonDropdown('Action', array(...)))); ?> <?php echo TbHtml::textField('appendedSplitDropdownButton', '', array('append' => TbHtml::splitButtonDropdown('Action', array(...)))); ?>
<?php echo TbHtml::beginFormTb(TbHtml::FORM_LAYOUT_SEARCH); ?> <?php echo TbHtml::searchQuery('appendedSearch', '', array('append' => TbHtml::submitButton('Search'), 'span' => 2)); ?> <?php echo TbHtml::searchQuery('prependedSearch', '', array('prepend' => TbHtml::submitButton('Search'), 'span' => 2)); ?> <?php echo TbHtml::endForm(); ?>
<?php echo TbHtml::textField('text', '', array('placeholder' => '.input-block-level', 'block' => true)); ?>
<?php echo TbHtml::textField('text', '', array( 'placeholder' => '.input-mini', 'size' => TbHtml::INPUT_SIZE_MINI)); ?> <?php echo TbHtml::textField('text', '', array( 'placeholder' => '.input-small', 'size' => TbHtml::INPUT_SIZE_SMALL)); ?> <?php echo TbHtml::textField('text', '', array( 'placeholder' => '.input-medium', 'size' => TbHtml::INPUT_SIZE_MEDIUM)); ?> <?php echo TbHtml::textField('text', '', array( 'placeholder' => '.input-large', 'size' => TbHtml::INPUT_SIZE_LARGE)); ?> <?php echo TbHtml::textField('text', '', array( 'placeholder' => '.input-xlarge', 'size' => TbHtml::INPUT_SIZE_XLARGE)); ?> <?php echo TbHtml::textField('text', '', array( 'placeholder' => '.input-xxlarge', 'size' => TbHtml::INPUT_SIZE_XXLARGE)); ?>
<?php echo TbHtml::textField('text', '', array('placeholder' => '.span1', 'span' => 1)); ?> <?php echo TbHtml::textField('text', '', array('placeholder' => '.span2', 'span' => 2)); ? <?php echo TbHtml::textField('text', '', array('placeholder' => '.span3', 'span' => 3)); ?> <?php echo TbHtml::dropDownList('dropDown', '', array('1'), array('span' => 1)); ?> <?php echo TbHtml::dropDownList('dropDown', '', array('1'), array('span' => 2)); ?> <?php echo TbHtml::dropDownList('dropDown', '', array('1'), array('span' => 3)); ?>
<?php echo TbHtml::controls(TbHtml::textField('text', '', array('placeholder' => '.span5', 'span' => 5))); ?> <?php echo TbHtml::controlsRow(array( TbHtml::textField('text', '', array('placeholder' => '.span4', 'span' => 4)), TbHtml::textField('text', '', array('placeholder' => '.span1', 'span' => 1)), )); ?> ...
<?php echo TbHtml::uneditableField('uneditable', 'Some value here'); ?>
<?php echo TbHtml::formActions(array( TbHtml::submitButton('Save changes', array('color' => TbHtml::BUTTON_COLOR_PRIMARY)), TbHtml::button('Cancel'), )); ?>
<?php echo TbHtml::textFieldControlGroup('text', '', array('help' => 'Inline help text')); ?>
A longer block of help text that breaks onto a new line and may extend beyond one line.
<?php echo TbHtml::textFieldControlGroup('text', '', array('help' => '...', 'helpOptions' => array('type' => TbHtml::HELP_TYPE_BLOCK))); ?>
<?php echo TbHtml::textField('text', '', array('placeholder' => '[email protected]', 'required' => true)); ?>
<?php echo TbHtml::textField('text', '', array('placeholder' => 'Disabled input here...', 'disabled' => true)); ?>
<?php echo TbHtml::textFieldControlGroup('text', '', array( 'label' => 'Input with warning', 'help' => 'Something may have gone wrong', 'color' => TbHtml::INPUT_COLOR_WARNING, )); ?> <?php echo TbHtml::textFieldControlGroup('text', '', array( 'label' => 'Input with error', 'help' => 'Please correct the error', 'color' => TbHtml::INPUT_COLOR_ERROR, )); ?> <?php echo TbHtml::textFieldControlGroup('text', '', array( 'label' => 'Input with info', 'help' => 'Username is taken', 'color' => TbHtml::INPUT_COLOR_INFO, )); ?> <?php echo TbHtml::textFieldControlGroup('text', '', array( 'label' => 'Input with success', 'help' => 'Woohoo!', 'color' => TbHtml::INPUT_COLOR_SUCCESS, )); ?>
<?php echo TbHtml::imageRounded('holder.js/140x140'); ?> <?php echo TbHtml::imageCircle('holder.js/140x140'); ?> <?php echo TbHtml::imagePolaroid('holder.js/140x140'); ?>
<?php echo TbHtml::icon(TbHtml::ICON_GLASS); ?>
Coming soon!