---
name: "HTML::Widget::Container"
section: "3pm"
platform: "linux"
package: "libhtml-widget-perl"
version: "1.11-7"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/HTML::Widget::Container"
---

# HTML::Widget::Container(3pm)

Container

## NAME

HTML::Widget::Container - Container

## SYNOPSIS

```
    my $container  = $form->element('foo');

    my $field = $container->field;
    my $error = $container->error;
        my $label = $container->label;
    my $field_xml      = $container->field_xml;
    my $error_xml      = $container->error_xml;
    my $javascript_xml = $container->javascript_xml;
    my $xml = $container->as_xml;
        # $xml eq "$container"
    my $javascript = $container->javascript;
```

## DESCRIPTION

Container.

## METHODS

### as\_xml

Return Value: `$xml`

### \_build\_element

Arguments: `$element`

Return Value: `@elements`

Convert `$element` to HTML::Element object. Accepts arrayref.

If you wish to change the rendering behaviour of HTML::Widget; specifically,  the handling of elements which are array-refs, you can specify  "container\_class" in HTML::Widget::Element to a custom class which just  overrides this function.

### build\_single\_element

Arguments: `$element`

Return Value: `$element`

Convert `$element` to HTML::Element object.

Called by "\_build\_element".

If you wish to change the rendering behaviour of HTML::Widget; specifically,  the handling of an individual element, you can override this function.

### build\_element\_error

Arguments: `$element`

Return Value: `$element`

Called by "build\_single\_element".

If you wish to change how an error is rendered, override this function.

### build\_element\_label

Arguments: `$element`, `$class`

Return Value: `$element`

Called by "build\_single\_element".

If you wish to change how an element's label is rendered, override this  function.

The `$class` argument is the original class of the element, before  "build\_element\_error" was called.

### as\_list

Return Value: `@elements`

Returns a list of HTML::Element objects.

### element

### field

Arguments: `$element`

"field" is an alias for "element".

### element\_xml

### field\_xml

Return Value: `$xml`

"field\_xml" is an alias for "element\_xml".

### error

Arguments: `$error`

Return Value: `$error`

### error\_xml

Return Value: `$xml`

### javascript

### js

Arguments: `$javascript`

Return Value: `$javascript`

"js" is an alias for "javascript".

### javascript\_element

Return Value: `$javascript_element`

Returns javascript in a script HTML::Element.

### javascript\_xml

### js\_xml

Return Value: `$javascript_xml`

Returns javascript in a script block.

"js\_xml" is an alias for "javascript\_xml".

## AUTHOR

Sebastian Riedel, `"sri@oook.de"`

## LICENSE

This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
