2017-03-10 6 views
0

입력란에 Glyphicons 아이콘을 어떻게 추가 할 수 있습니까?Glyphicons 아이콘을 입력하는 방법은 무엇입니까?

코드의 일부 :

class GrupoUsuarioForm{ 
     $this->setAttributes(array(
      'method' => 'POST', 
      'class' => 'formGrupoUsuario', 
      'name' => 'formGrupoUsuario' 
    )); 
    $this->setInputFilter(new GrupoUsuarioInputFilter());  

    $dataCadastro = new Text('data_grp'); 
    $dataCadastro->setValue(date('d/m/Y')) 
    ->setAttributes(array(
    //'style' => 'width: 20%', 
    'id', 'dataGrp', 
    'readOnly' => 'true' 
    )); 
    $dataCadastro->setLabel('Data do Cadastro');   
    $this->add($dataCadastro); 

이 반환 HTML이 아이콘을 넣어 싶어 excatly

<label>Textbox with calendar icon</label> 
    <div class="input-append"><input type="text" id="" name=""> 
    <span class="add-on"><i class="icon-calendar"></i></span></div> 

답변

0

을 하시겠습니까? 양식 요소를 원하는대로 렌더링 할 수 있습니다. 컨트롤러에서

:

public function myAction() 
{ 
    return new ViewModel([ 
     'form' => new GrupoUsuarioForm() 
    ]); 
} 

보기에서 :

// HTML code here 
... 
<?php $form = $this->form; ?> 
<?php $form->prepare(); ?> 
<?php echo $this->form()->openTag($form); ?> 
... 
<?php echo $this->formLabel($form->get('data_grp')); ?> 
<div class="input-group"> 
    <div class="input-append"> 
     <?php echo $this->formInput($form->get('data_grp')); ?> 
     <span class="add-on"><i class="icon-calendar"></i></span> 
    </div> 
</div> 
... 
<?php echo $this->form()->closeTag(); ?> 
+0

내가 입력을 가진 클래스가, 형태는 이러한 입력을 사용하는 방법은 무엇 PHTML 페이지 –

+0

에 있지? – SzymonM

+0

위의 코드에서 파트를 추가했습니다. –