Habari\FormContainer::get_contents PHP Метод

get_contents() публичный Метод

Get the control contents of this container
public get_contents ( Theme $theme ) : string
$theme Theme The theme used to render the controls
Результат string The requested HTML output
    function get_contents(Theme $theme)
    {
        $content = '';
        /** @var FormControl $control */
        foreach ($this->controls as $control) {
            $wrap = $this->get_setting('wrap_each', '%s');
            if ($class = $this->get_setting('class_each', '')) {
                $control->add_class($class);
            }
            if (isset($control->settings['wrap'])) {
                $content .= $control->get($theme);
            } else {
                $control_content = $control->get($theme);
                if ($control_content != '') {
                    $content .= sprintf($wrap, $control_content);
                }
            }
        }
        return $content;
    }