Skip to content

Instantly share code, notes, and snippets.

@moltar
Created December 14, 2012 15:53
Show Gist options
  • Save moltar/4286404 to your computer and use it in GitHub Desktop.
Save moltar/4286404 to your computer and use it in GitHub Desktop.
Bootstrap inline help
package SW::Web::Form::Component::InlineHelp;
use warnings;
use strict;
use HTML::FormHandler::Moose::Role;
=head2 inline_help
Inline help for a field.
=cut
has inline_help => (
is => 'ro',
isa => 'Str',
);
before wrap_field => sub {
my $self = shift;
$self->set_tag('after_element',
' <span class="help-inline help">'
. $self->html_filter($self->_localize(($self->inline_help)))
. '</span>');
};
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment