From 368f96119b7f843805453943cd1206afefd5cd72 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 27 Dec 2010 13:44:06 +0100 Subject: [PATCH] select_tag: Automatischer Aufruf von options_for_select falls Optionen-Argument kein String ist --- SL/Template/Plugin/L.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SL/Template/Plugin/L.pm b/SL/Template/Plugin/L.pm index d9fd3c1f5..ec0c2d02f 100644 --- a/SL/Template/Plugin/L.pm +++ b/SL/Template/Plugin/L.pm @@ -71,6 +71,7 @@ sub select_tag { my %attributes = _hashify(@_); $attributes{id} ||= $self->name_to_id($name); + $options_str = $self->options_for_select($options_str) if ref $options_str; return $self->html_tag('select', $options_str, %attributes, name => $name); } @@ -280,8 +281,10 @@ Creates a HTML 'select' tag named C<$name> with the contents C<$options_string> and with arbitrary HTML attributes from C<%attributes>. The tag's C defaults to C. -The $options_string is usually created by the C -function. +The C<$options_string> is usually created by the +L function. If C<$options_string> is an array +reference then it will be passed to L +automatically. =item C -- 2.20.1