最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Yii用AutoComplete实现表单自动提示
时间:2022-06-25 00:53:54 编辑:袖梨 来源:一聚教程网
基本用法如下:
controller层代码:
-------------------------------------------
代码如下 | 复制代码 |
class SiteController extends Controller { public function actionIndex() { $data=array('Nanjing', 'Beijing', 'Perth', 'Chicago','Paris','Pengnai','Sydney'); $this->render('index', array( 'data' => $data, )); } } |
view层代码:
------------------------------------------------------
代码如下 | 复制代码 |
$this->widget('zii.widgets.jui.CJuiAutoComplete', array( 'name'=>'city', 'source'=>$data, 'options'=>array( 'minLength'=>'1',//设置文本框中有最少有几个字符的时候开始提示 ), 'htmlOptions'=>array( 'style'=>'height:20px;' ), )); ?> |
相关文章
- 《我的门派》输出装备搭配攻略 输出怎么搭配装备? 04-27
- 战火与永恒礼包码大全 04-27
- 《辐射4》q键使用介绍 04-26
- 《辐射4》人物介绍 04-26
- 《下一站江湖2》风卷残云获得方法 04-26
- 《The Star Named EOS未晓星程》配置要求介绍 04-26