PHP Classes

File: vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_options.html.php

Recommend this page to a friend!
  Classes of Murat Cileli   Papernic   vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_options.html.php   Download  
File: vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_options.html.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Papernic
Manage documents colaboratively
Author: By
Last change:
Date: 7 years ago
Size: 1,110 bytes
 

Contents

Class file image Download
<?php use Symfony\Component\Form\ChoiceList\View\ChoiceGroupView;

$translatorHelper = $view['translator']; // outside of the loop for performance reasons! ?>
<?php $formHelper
= $view['form']; ?>
<?php
foreach ($choices as $group_label => $choice): ?>
<?php if (is_array($choice) || $choice instanceof ChoiceGroupView): ?>
<optgroup label="<?php echo $view->escape(false !== $choice_translation_domain ? $translatorHelper->trans($group_label, array(), $choice_translation_domain) : $group_label) ?>">
            <?php echo $formHelper->block($form, 'choice_widget_options', array('choices' => $choice)) ?>
</optgroup>
    <?php else: ?>
<option value="<?php echo $view->escape($choice->value) ?>" <?php echo $view['form']->block($form, 'attributes', array('attr' => $choice->attr)) ?><?php if ($is_selected($choice->value, $value)): ?> selected="selected"<?php endif?>><?php echo $view->escape(false !== $choice_translation_domain ? $translatorHelper->trans($choice->label, array(), $choice_translation_domain) : $choice->label) ?></option>
    <?php endif ?>
<?php
endforeach ?>