label() public method

Renders the label of the given view.
public label ( Symfony\Component\Form\FormView $view, string $label = null, array $variables = [] ) : string
$view Symfony\Component\Form\FormView The view for which to render the label
$label string The label
$variables array Additional variables passed to the template
return string The html markup
コード例 #1
0
 /**
  * @param array $params
  * @param Smarty_Internal_Template $smartyTemplate
  * @author Martin Schindler
  * @return string
  */
 public function formLabel(array $params, Smarty_Internal_Template $smartyTemplate)
 {
     $form = $params['form'];
     unset($params['form']);
     $label = null;
     if (array_key_exists('label', $params)) {
         $label = $params['label'];
         unset($params['label']);
     }
     return $this->formHelper->label($form, $label, $params);
 }
コード例 #2
0
ファイル: Templates.php プロジェクト: scottleedavis/hackazon
 /**
  * @param $form FormView
  * @param FormHelper $formHelper
  */
 public function context_collection_row($form, $formHelper)
 {
     if ($form->count()) {
         echo $formHelper->label($form);
     }
     echo $formHelper->errors($form);
     echo $formHelper->widget($form);
     echo $formHelper->rest($form);
 }