Render state field
337162
public function main()
    {
        $buffer = '';
        $registry = GeneralUtility::makeInstance('KayStrobach\Dyncss\Configuration\BeRegistry');
        $handlers = $registry->getAllFileHandler();
        if (count($handlers)) {
            foreach ($handlers as $extension => $class) {
                /** @var AbstractParser $parser */
                $parser = new $class();
                $buffer .= '<tr><td>*.'.$extension.'</td>';
                $buffer .= '<td>'.$class.'</td>';
                $buffer .= '<td><a href="'.$parser->getParserHomepage().'" target="_blank">'.$parser->getParserName().'</a></td>';
                $buffer .= '<td>'.$parser->getVersion().'</td>';
                $buffer .= '</tr>';
            }
            /** @var FlashMessage $flashMessage */
            $flashMessage = GeneralUtility::makeInstance(
                FlashMessage::class,
                'Congrats, you have '.count($handlers).' handlers registered.',
                '',
                FlashMessage::OK,
                true
            );
            $this->addFlashMessage($flashMessage);
            $buffer = '<table class="t3-table table"><thead><tr><th>extension</th><th>class</th><th>name</th><th>version</th></tr></thead>'.$buffer.'</table>';
        } else {
            /** @var FlashMessage $flashMessage */
            $flashMessage = GeneralUtility::makeInstance(
                FlashMessage::class,
                'Please install one of the dyncss_* extensions',
                'No handler registered! - No dynamic css is handled at all ;/',
                FlashMessage::WARNING,
                true
            );
            $this->addFlashMessage($flashMessage);
            return $this->renderFlashMessage();
        }
        $renderedFlashMessages = $this->renderFlashMessage();
        return $renderedFlashMessages . $buffer;
    }
965109
function renderiBooksField() {
		$this->renderField(
			[
				'id' => 'ibooks',
				'name' => $this->getSlug(),
				'option' => 'ibooks',
				'value' => ( isset( $this->options['ibooks'] ) ) ? $this->options['ibooks'] : '',
				'type' => 'url',
				'class' => 'regular-text code',
			]
		);
	}
1126606
public function renderFields()
    {
        // Save fields in DB
        $this->saveFields();

        // Get contents
        $pageCurrent = $this->currentPage;
        $sectionCurrent = $this->currentSection;
        $formFields = $this->fields;
        $contentOptions = $this->options;

        // Get links
        $u_link = 'page='.$pageCurrent;
        $u_section = !empty($sectionCurrent) ? '&section='.$sectionCurrent : '';

        // Work on vars
        $vars = [
            'title'         => $contentOptions['title'],
            'description'   => $contentOptions['description'],
            'submit'        => $contentOptions['submit'],

            // Texts and URLs
            't_submit'      => Translate::t('adminpage.submit'),
            'u_link'        => $u_link,
            'u_action'      => admin_url('admin.php?'.$u_link.$u_section),
        ];

        // Display sections
        if (!empty($contentOptions['sections']) && is_array($contentOptions['sections'])) {
            foreach ($contentOptions['sections'] as $slug => $opts) {
                // Update option
                $opts['slug'] = $slug;
                $opts['u_link'] = admin_url('admin.php?'.$u_link.'&section='.$slug);

                // Update vars
                $vars['sections'][] = $opts;

                if ($slug !== $sectionCurrent) {
                    continue;
                }

                // Update vars
                $vars['submit'] = $opts['submit'];
            }
        }

        // Work on current vars
        $vars['c_page'] = $pageCurrent;
        $vars['c_section'] = $sectionCurrent;

        // Display fields
        if (!empty($formFields)) {
            foreach ($formFields as $field) {
                if (!$field) {
                    continue;
                }

                $vars['fields'][] = $field->render([], [
                    'template' => 'adminpage',
                ], false);
            }
        }

        // Render view
        Render::view('adminpage.html.twig', $vars, 'adminpage');
    }
852279
public function renderField()
    {
        list($name, $id) = $this->resolveNameID();

        TbArray::defaultValue('id', $id, $this->htmlOptions);
        TbArray::defaultValue('name', $name, $this->htmlOptions);

        if ($this->useHelperSelectBox) {
            $select = Yii::createComponent(
                CMap::mergeArray(
                    $this->helperOptions,
                    array(
                        'class' => 'yiiwheels.widgets.formhelpers.WhSelectBox',
                        'htmlOptions' => $this->htmlOptions,
                        'model' => $this->model,
                        'attribute' => $this->attribute,
                        'name' => $this->name,
                        'value' => $this->value,
                        'wrapperOptions' => array(
                            'class' => 'bfh-fonts',
                            'data-family' => $this->hasModel() ? $this->model->{$this->attribute} : $this->value,
                        )
                    )
                )
            );
            $select->init();
            $select->run();
        } else {
            $this->htmlOptions['data-family'] = $this->hasModel()
                ? $this->model->{$this->attribute}
                : $this->value;

            if ($this->hasModel()) {
                echo CHtml::activeDropDownList($this->model, $this->attribute, array(), $this->htmlOptions);
            } else {
                echo CHtml::dropDownList($name, $this->value, array(), $this->htmlOptions);
            }
        }
    }
93369
public function renderField()
    {
        list($name, $id) = $this->resolveNameID();

        if ($this->hasModel()) {
            echo CHtml::activeHiddenField($this->model, $this->attribute, $this->htmlOptions);
        } else {
            echo CHtml::hiddenField($name, $this->value, $this->htmlOptions);
        }

        echo '<div id="slider_' . $id . '"></div>';
    }
1280540
public function render_field($field)
    {
        // convert value to array
        $field['value'] = acf_get_array($field['value'], false);

        // add empty value (allows '' to be selected)
        if (empty($field['value'])) {
            $field['value'][''] = '';
        }

        // placeholder
        if (empty($field['placeholder'])) {
            $field['placeholder'] = __("Select",'acf');
        }

        // vars
        $atts = array(
            'id'                => $field['id'],
            'class'             => $field['class'],
            'name'              => $field['name'],
            'data-multiple'     => $field['multiple'],
            'data-placeholder'  => $field['placeholder'],
            'data-allow_null'   => $field['allow_null']
        );

        // multiple
        if ($field['multiple']) {
            $atts['multiple'] = 'multiple';
            $atts['size'] = 5;
            $atts['name'] .= '[]';
        }

        // special atts
        foreach (array( 'readonly', 'disabled' ) as $k) {
            if (!empty($field[ $k ])) {
                $atts[ $k ] = $k;
            }
        }

        // vars
        $els = array();
        // $choices = array();

        $posttypes = $this->post_type_options();
        foreach ($posttypes as $pt) {
            $els[] = array(
                'type' => 'option',
                'value' => $pt['value'],
                'label' => $pt['label'],
                'selected' => in_array($pt['value'], $field['value'])
            );
        }

        // null
        if ($field['allow_null']) {
            array_unshift($els, array(
                'type' => 'option',
                'value' => '',
                'label' => '- ' . $field['placeholder'] . ' -'
            ));
        }

        // html
        echo '<select ' . acf_esc_attr($atts) . '>';

        // construct html
        if (!empty($els)) {
            foreach ($els as $el) {
                // extract type
                $type = acf_extract_var($el, 'type');
                if ($type == 'option') {
                    // get label
                    $label = acf_extract_var($el, 'label');
                    // validate selected
                    if (acf_extract_var($el, 'selected')) {
                        $el['selected'] = 'selected';
                    }

                    // echo
                    echo '<option ' . acf_esc_attr($el) . '>' . $label . '</option>';
                } else {
                    // echo
                    echo '<' . $type . ' ' . acf_esc_attr($el) . '>';
                }


            }

        }

        echo '</select>';
    }
382694
function renderKoboField() {
		$this->renderField(
			[
				'id' => 'kobo',
				'name' => $this->getSlug(),
				'option' => 'kobo',
				'value' => ( isset( $this->options['kobo'] ) ) ? $this->options['kobo'] : '',
				'type' => 'url',
				'class' => 'regular-text code',
			]
		);
	}
958211
def custom_field_rendering(context, field, *args, **kwargs):
    
    if CUSTOM_FIELD_RENDERER:
        mod, cls = CUSTOM_FIELD_RENDERER.rsplit(".", 1)
        field_renderer = getattr(import_module(mod), cls)
        if field_renderer:
            return field_renderer(field, **kwargs).render()
    return field
1298624
def render_field_description(field):
    
    if hasattr(field, 'description') and field.description != '':
        html = """<p class="help-block">{field.description}</p>"""
        html = html.format(
            field=field
        )
        return HTMLString(html)
    
    return ''
994237
def __render_tag(info, state):
    
    new_contexts, context_match = get_tag_context(info['tag_key'], state)
    replacement = ''

    if context_match or context_match == 0:
        replacement = context_match
    elif info['tag_key'] == '.':
        replacement = state.context()
    else:
        replacement = ''

    # Call all callables / methods / lambdas / functions
    if replacement and callable(replacement):
        replacement = make_unicode(replacement())

        state.push_tags(state.default_tags)
        replacement = __render(template=replacement, state=state)
        state.pop_tags()

    for i in xrange(new_contexts): state.context.pop()

    if state.escape():
        return html_escape(replacement)
    return replacement
1111950
def render(opts, functions, states=None, proxy=None, context=None):
    '''
    
    '''
    if context is None:
        context = {}

    pack = {'__salt__': functions,
            '__grains__': opts.get('grains', {}),
            '__context__': context}

    if states:
        pack['__states__'] = states
    pack['__proxy__'] = proxy or {}
    ret = LazyLoader(
        _module_dirs(
            opts,
            'renderers',
            'render',
            ext_type_dirs='render_dirs',
        ),
        opts,
        tag='render',
        pack=pack,
    )
    rend = FilterDictWrapper(ret, '.render')

    if not check_render_pipe_str(opts['renderer'], rend, opts['renderer_blacklist'], opts['renderer_whitelist']):
        err = ('The renderer {0} is unavailable, this error is often because '
               'the needed software is unavailable'.format(opts['renderer']))
        log.critical(err)
        raise LoaderError(err)
    return rend
81746
protected void renderAttributes(int type, AbstractRenderAppender sb, AbstractAttributeState state, boolean doubleQuote)
    {
        HashMap map = null;
        switch (type) {
            case AbstractHtmlState.ATTR_JAVASCRIPT:
                assert(state instanceof AbstractHtmlState) : "ATTR_JAVASCRIPT requires a AbstractHtmlState instance";
                AbstractHtmlState htmlState = (AbstractHtmlState) state;
                map = htmlState.getEventMap();
                break;
            default:
                super.renderAttributes(type, sb, state, doubleQuote);
                return;
        }
        renderGeneral(map, sb, doubleQuote);
    }
913815
protected void setState(FieldState state) {
        if (DEBUG)
            LOG.debug("{}:{} --> {}", _state, _field != null ? _field : _headerString != null ? _headerString : _string, state);
        _fieldState = state;
    }
1057608
def render(object, fields, view = nil, context: Attributor::DEFAULT_ROOT_CONTEXT)
      if fields.is_a? Array
        sub_fields = fields[0]
        object.each_with_index.collect do |sub_object, i|
          sub_context = context + ["at(#{i})"]
          render(sub_object, sub_fields, view, context: sub_context)
        end
      elsif object.is_a? Praxis::Blueprint
        @cache[object.object_id][fields.object_id] ||= _render(object, fields, view, context: context)
      else
        _render(object, fields, view, context: context)
      end
    rescue SystemStackError
      raise CircularRenderingError.new(object, context)
    end
36334
def state(anon, obj, field, val):
    
    return anon.faker.state(field=field)
543639
def render(self):
        '''
        
        '''
        data = self.prepare_data()
        if self.field.readable:
            return self.env.template.render(self.template, **data)
        return ''
207316
public void renderDiv(DivTag.State state, TreeElement elem)
    {
        ArrayList al = _lists[TreeHtmlAttributeInfo.HTML_LOCATION_DIV];

        assert(al != null);
        if (al.size() == 0)
            return;

        int cnt = al.size();
        for (int i = 0; i < cnt; i++) {
            TreeHtmlAttributeInfo attr = (TreeHtmlAttributeInfo) al.get(i);
            state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, attr.getAttribute(), attr.getValue());
        }
    }