Lithium表单助手HTML模板

时间:2015-04-15 21:22:45

标签: php helper lithium form-helpers

我想生成a)写作时b)我相信可以使用表单助手/模板。

A)

<div class="SomeClass">
    <span>
        <i class="some OtherClass "></i>
    </span>
    <input type="text" ... >
</div>
<h4 class="error">Validation Message Goes Here</h4>

b)

<?= $this->form->field('name',array('label'=>false, 'placeholder'=>'someHolder')); ? >

1 个答案:

答案 0 :(得分:1)

锂形式课程有惊人的评论。

你应该尝试这样的事情:

<?php
echo $this->form->create(null);
echo $this->form->field(
    'name',
    [
        'template' => '<div{:wrap}><span><i class="some OtherClass"></i></span>{:input}</div>',
        'wrap' => ['class' => 'SomeClass'],
    ]
);
echo $this->form->error('name', null, ['template' => '<h4 class="error">{:content}</h4>']);
echo $this->form->end();
?>
相关问题