HTML::...:Block(3pm)
π NAME π
HTML::Widget::Element::Block β Block Level Element, bestie. That's the whole vibe. π
β¨ SYNOPSIS β¨
my $e = $widget->element( 'Block', 'div' );
$e->value('bar');
π DESCRIPTION π
Okay so this is a Block Level Element. That's it, that's the whole thing. It's the base class for HTML::Widget::Element::Fieldset, so if you're messing with fieldsets, you're already living in this house. π β¨
π METHODS π
πΈ new πΈ
Returns a new Block element. But lowkey? You usually don't need to call this yourself β just use $widget->element() or $block->element() to spin up a fresh Block element inside a widget or element that already exists. Let the parents handle it, fr fr. π«Ά
π type π
Default value is div, which creates a <div> container for you. You can change it, though β swap it to create a tag of any type. Customisation era. π
π¦ element π¦
Add a new element, nested all cute and cozy within this Block. For the full documentation, go read "element" in HTML::Widget. Go on, I'll wait. π
β push_content β
Add previously-created elements to the end of this block's elements. Back of the line, babe.
π§ unshift_content π§
Add previously-created elements to the start of this block's elements. Front of the line, main character energy only. π
π block_container π
Creates a new block container object of type $self->block_container_class. Defaults to HTML::Widget::BlockContainer. So polite of it to have a default. π
π block_container_class π
Sets the class to be used by $self->block_container. And plot twist β you can call it as a class method or an instance method. Flexible icon behaviour. β¨
π₯ containerize π₯
Containerizes the block and all its contained elements so they're ready for later rendering. It uses HTML::Widget::BlockContainer by default, but you can over-ride that on a class or instance basis via block_container_class. You're in charge, periodt.
π get_elements π
my @elements = $self->get_elements;
my @elements = $self->get_elements( type => 'Textfield' );
my @elements = $self->get_elements( name => 'username' );
Returns a list of all elements added to the widget.
- If a
'type'argument is given, it only returns the elements of that type. - If a
'name'argument is given, it only returns the elements with that name.
Filtered. Curated. Slay. π
π get_element π
my $element = $self->get_element;
my $element = $self->get_element( type => 'Textfield' );
my $element = $self->get_element( name => 'username' );
Basically get_elements(), but it only returns the first element in the list. Just the one. The chosen one.
Accepts the same arguments as get_elements(). π«Ά
π find_elements π
Similar to get_elements(), and it has the same alternate forms, but this one does a recursive search through itself and all its child elements. It goes deep. It finds things. No cap. πβ¨
π SEE ALSO π
HTML::Widget::Element
π«Ά AUTHOR π«Ά
Michael Gray, "mjg@cpan.org" β iconic, honestly.
π LICENSE π
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
And that's the whole page, bestie!! This one's from perl v5.36.0, dated 2023-08-10, and it lives in the User Contributed Perl Documentation under HTML::...:Block(3pm). Mwah, go forth and block-level-element responsibly πππ¦
π¦ where this page comes from
- debian trixie: libhtml-widget-perl 1.11-7 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libhtml-widget-perl 1.11-7 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libhtml-widget-perl 1.11-7 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libhtml-widget-perl 1.11-7 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms