有人可以帮助我吗?
我需要这样的东西:
<div class="form-group">
<label for="per_cor">
Correo Electronico <span class="text-danger">*</span>:
</label>
<input type="email" name="per_cor" id="per_cor" class="form-control" placeholder="Correo Electronico" value="" required >
</div>
目前,我只完成了此操作:(
如何添加标签 span ?
<div class="form-group">
<label for="per_cor">
Correo Electronico:
</label>
<input name="per_cor" type="text" class="form-control " id="per_cor" placeholder="Correo Electronico" required="required" data-parsley-alpha="" value="">
</div>
这是我在Form类中的声明
class FrmPreReg extends Form {
...
$this->add(array(
"name" => "per_cor",
"options" => array(
"label" => "Correo Electronico:"
),
"attributes" => array(
"type" => "text",
"class" => "form-control ",
"id" => "per_cor",
"placeholder" => "Correo Electronico:",
"required" => "required",
"data-parsley-alpha" => "",
)
));
这是我在HTML中的声明
<div class="form-group">
<?= $this->formLabel($form->get("per_nom")) ?>
<?= $this->formElement($form->get("per_nom")) ?>
<?= $this->formElementErrors()->render($form->get("per_nom"), ['class' => 'help-block']) ?>
</div>