Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 99d0bd2b

Von Moritz Bunkus vor etwa 7 Jahren hinzugefügt

  • ID 99d0bd2b810d7d4268c104d0a0ea8e67a63b55d2
  • Vorgänger 36d1d6a4
  • Nachfolger 5ab937c5

Presenter: mehr Funktionen von L in Tag-Presenter verschieben

Unterschiede anzeigen:

SL/Template/Plugin/L.pm
76 76
sub button_tag               { return _call_presenter('button_tag',               @_); }
77 77
sub submit_tag               { return _call_presenter('submit_tag',               @_); }
78 78
sub ajax_submit_tag          { return _call_presenter('ajax_submit_tag',          @_); }
79
sub link                     { return _call_presenter('link',                     @_); }
79 80

  
80 81
sub _set_id_attribute {
81 82
  my ($attributes, $name, $unique) = @_;
......
138 139
  return $self->html_tag('li', $content, @slurp);
139 140
}
140 141

  
141
sub link {
142
  my ($self, $href, $content, %params) = _hashify(3, @_);
143

  
144
  $href ||= '#';
145

  
146
  return $self->html_tag('a', $content, %params, href => $href);
147
}
148

  
149 142
sub yes_no_tag {
150 143
  my ($self, $name, $value, %attributes) = _hashify(3, @_);
151 144

  
......
479 472

  
480 473
=item * C<input_tag $name, $value, %attributes>
481 474

  
475
=item * C<hidden_tag $name, $value, %attributes>
476

  
477
=item * C<checkbox_tag $name, %attributes>
478

  
482 479
=item * C<select_tag $name, \@collection, %attributes>
483 480

  
481
=item * C<link $href, $content, %attributes>
482

  
484 483
=back
485 484

  
486 485
Available high-level functions implemented in this module:
......
494 493
which entry is selected. The C<%attributes> are passed through to
495 494
L<select_tag>.
496 495

  
497
=item C<hidden_tag $name, $value, %attributes>
498

  
499
Creates a HTML 'input type=hidden' tag named C<$name> with the value
500
C<$value> and with arbitrary HTML attributes from C<%attributes>. The
501
tag's C<id> defaults to C<name_to_id($name)>.
502

  
503 496
=item C<textarea_tag $name, $value, %attributes>
504 497

  
505 498
Creates a HTML 'textarea' tag named C<$name> with the content
506 499
C<$value> and with arbitrary HTML attributes from C<%attributes>. The
507 500
tag's C<id> defaults to C<name_to_id($name)>.
508 501

  
509
=item C<checkbox_tag $name, %attributes>
510

  
511
Creates a HTML 'input type=checkbox' tag named C<$name> with arbitrary
512
HTML attributes from C<%attributes>. The tag's C<id> defaults to
513
C<name_to_id($name)>. The tag's C<value> defaults to C<1>.
514

  
515
If C<%attributes> contains a key C<label> then a HTML 'label' tag is
516
created with said C<label>. No attribute named C<label> is created in
517
that case.
518

  
519
If C<%attributes> contains a key C<checkall> then the value is taken as a
520
JQuery selector and clicking this checkbox will also toggle all checkboxes
521
matching the selector.
522

  
523 502
=item C<date_tag $name, $value, %attributes>
524 503

  
525 504
Creates a date input field, with an attached javascript that will open a

Auch abrufbar als: Unified diff