我想在zend框架项目中使用angularJS,在这个项目中,表单是使用zend形式生成的.如何在表单元素中添加角度指令,如"ng-model",但每当我尝试在zend-form元素中添加此自定义属性(输入,选择等)时,我都没有得到这个属性--- -
这是我的主要形式
class LeadForm扩展Form {
public function __construct() {
parent::__construct('lead_form');
$this->setAttributes(array(
'action' => '',
'method' => 'post',
'name' => 'lead_form',
'id' => 'lead_form',
'class' => 'smart-form',
'role' => 'form',
'novalidate' => 'novalidate'
));
$this->add(array(
'name' => 'first_name',
'type' => 'text',
'options' => array(
'label' => 'First Name',
),
'attributes' => array(
'class' => 'form-control validate[required,custom[onlyLetterSp]]',
'placeholder' => 'First name',
**'ng-model' => "first_name", // this attribute is not generating in view**
),
));
}
Run Code Online (Sandbox Code Playgroud)
}
这是我的控制器,它调用此表单并发送到视图进行显示
$createLeadForm = new \Admin\Form\LeadForm(); …Run Code Online (Sandbox Code Playgroud)