最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Yii用AutoComplete实现表单自动提示
时间:2014-11-17 编辑:简简单单 来源:一聚教程网
基本用法如下:
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;' ), )); ?> |
相关文章
- PHP导出数据超时的优化建议解读 10-31
- PHP之mysql位运算解析 10-31
- Laravel实现登录跳转功能解析 10-31
- php双向队列解读 10-31
- Laravel异常上下文解决教程 10-24
- php数组查询元素位置方法介绍 10-24