_form_field.php 1.56 KB
Newer Older
Яков's avatar
first  
Яков committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php if ($field->isPartial()): ?>
  <?php include_partial('cat/'.$name, array('form' => $form, 'attributes' => $attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes)) ?>
<?php elseif ($field->isComponent()): ?>
  <?php include_component('cat', $name, array('form' => $form, 'attributes' => $attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes)) ?>
<?php else: ?>
  <div class="<?php echo $class ?><?php $form[$name]->hasError() and print ' errors' ?>">
    <div>
      <?php $opts = $form[$name]->getWidget()->getOptions(); ?>
      <?php if (key_exists('type', $opts) && $opts['type'] == 'checkbox'): ?>
        <div class="content"><label><?php echo $form[$name]->render($attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes); ?><?php echo $label; ?></label></div>
      <?php else: ?>
        <span class="inline-label"><?php echo $form[$name]->renderLabel($label) ?></span>
        <div class="content">
          <?php echo $name == 'alias' ? 'catalog/' : ''; ?>
          <?php echo $form[$name]->render($attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes) ?>
          <?php echo $name == 'alias' ? '/' : ''; ?>

            <?php echo $form[$name]->renderError() ?>
          <?php if ($help): ?><span class="help"><?php echo __($help, array(), 'messages') ?></span><?php elseif ($help = $form[$name]->renderHelp()): ?><span class="help"><?php echo strip_tags($help, '<a><i>') ?></span><?php endif; ?>
        </div>
      <?php endif; ?>
    </div>
  </div>
<?php endif; ?>