Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 1ec0f541

Von Moritz Bunkus vor mehr als 12 Jahren hinzugefügt

  • ID 1ec0f541eb70afb7b2058acf9d6847e6e6e21dff
  • Vorgänger abde405d
  • Nachfolger e8a2b965

Helferfunktion L.yes_no_tag()

Implementiert die Standard-"Ja/Nein"-Selectbox via L.select_tag(...,
L.options_for_select())

Unterschiede anzeigen:

SL/Template/Plugin/L.pm
return $code;
}
sub yes_no_tag {
my ($self, $name, $value) = splice @_, 0, 3;
my %attributes = _hashify(@_);
my $options = $self->options_for_select([ [ 1, $::locale->text('Yes') ], [ 0, $::locale->text('No') ] ], default => $value ? 1 : 0);
return $self->select_tag($name, $options, %attributes);
}
sub javascript {
my ($self, $data) = @_;
return $self->html_tag('script', $data, type => 'text/javascript');
......
reference then it will be passed to L</options_for_select>
automatically.
=item C<yes_no_tag $name, $value, %attributes>
Creates a HTML 'select' tag with the two entries C<yes> and C<no> by
calling L<select_tag> and L<options_for_select>. C<$value> determines
which entry is selected. The C<%attributes> are passed through to
L<select_tag>.
=item C<input_tag $name, $value, %attributes>
Creates a HTML 'input type=text' tag named C<$name> with the value

Auch abrufbar als: Unified diff