syntax error, unexpected '=>' (T_DOUBLE_ARROW)
我希望在保留htmloptions时显示表单标记的类,它会显示错误。
<?php $form=$this->beginWidget('CActiveForm', array(
'action'=>Yii::app()->createUrl($this->route),
'method'=>'get',
),
'htmlOptions'=>array('class'=>'form-inline'),
));
?>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<?php echo $form->textField($model,'title',array('class'=>'form-control','placeholder'=>'title')); ?>
<?php echo $form->error($model,title); ?>
</div>
<div class="form-group">
<?php echo $form->dropDownList($model,'functional_area', CHtml::listData(FunctionalArea::model()->findAll(), 'id', 'functional_area'), array('empty' => 'Functional Area','class'=>'form-control')); ?>
<?php echo $form->error($model,functional_area); ?>
</div>
<div class="form-group">
<?php echo $form->textField($model,'state',array('class'=>'form-control','placeholder'=>'state')); ?>
<?php echo $form->error($model,state); ?>
</div>
<div class="form-group">
<?php echo $form->dropDownList($model,'experience_min', range(0,50), array('empty' => 'Select','class'=>'form-control')); ?>
<?php echo $form->error($model,experience_min); ?>
</div>
<div class="form-group">
<?php echo $form->dropDownList($model,'experience_max', range(0,50), array('empty' => 'Select','class'=>'form-control')); ?>
<?php echo $form->error($model,experience_max); ?>
</div>
<?php echo CHtml::submitButton('Search',array('class'=>'red_btn')); ?>
<input type="hidden" name="Jobs[user_id]" value="<?php echo $user_id;?>" />
<?php $this->endWidget(); ?>
</ul>
</div>
</div>
答案 0 :(得分:3)
Hello rockstar,欢迎来到Stackoverflow。
你在括号中犯了一个错误。将上面的代码部分更改为以下内容:
<?php
$form = $this->beginWidget('CActiveForm', array(
'action' => Yii::app()->createUrl($this->route),
'method' => 'get',
'htmlOptions' => array(
'class' => 'form-inline'
)
));
?>