### showDatadicts
**设置页面数据字典项**
**参数**
传入的数组key为页面上设置的模板字符串,value为后台设置的父亲code
$parentCodeArr : 数据字典编码数组
$keyCode : 需要转换的数据
$emptyOption : true/false 是否加入一个空的option
$$conditionArr: 查找条件数组
~~~
function showDatadicts($parentCodeArr, $keyCode = null, $emptyOption = false ,$conditionArr = null) {
if (is_array ( $parentCodeArr )) {
$datadictArr = $this->getDatadicts ( $parentCodeArr ,$conditionArr);
//print_r($datadictArr);
foreach ( $datadictArr as $key => $valueArr ) {
$str = "";
if ($emptyOption) {
$str .= "";
}
if (is_array ( $valueArr )) {
foreach ( $valueArr as $k => $v ) {
$eStr = 'e1="' . $v ['expand1'] . '" e2="' . $v ['expand2'] . '" e3="' . $v ['expand3'] . '" e4="' . $v ['expand4'] . '" e5="' . $v ['expand5'] . '"';
if ($v ['dataCode'] == $keyCode)
$str .= '';
else
$str .= '';
$str .= $v ['dataName'];
$str .= '';
}
}
$k = array_search ( $key, $parentCodeArr );
$this->show->assign ( $k == false ? $key : $k, $str );
}
}
}
~~~
**例:**
~~~
...
...
$this->showDatadicts(array ('contractType' => 'HTLX'), $obj['contractType']);
...
...
~~~
- 架构
- 基础框架文档
- base/action(C层基类)
- protected 类定义
- __construct构造函数
- c_list
- c_index
- c_page
- c_pageJson
- c_listJson
- c_getByAjax
- c_getCountByName
- c_toAdd
- c_add
- c_init
- c_edit
- c_deletes
- c_ajaxdeletes
- c_saveBatch
- c_checkRepeat
- getDatadicts
- showDatadicts
- getDataNameByCode
- assign
- display
- view
- assignFunc
- model/base(M层基类)
- protected类定义(model)
- __construct
- find
- get_table_fields
- findAll
- findSql
- create
- delete
- findBy
- updateField
- query
- findCount
- update
- filterFunc
- filterField
- filterWithoutField
- filterCustom
- createBatch
- pageBySql
- listBySql
- pageBySqlId
- deletes
- 事务控制
- 获取对象数组
- addBatch_d
- add_d
- edit_d
- isRepeat
- 列表组件文档
- 基础表格
- 数据获取
- 表格数据显示
- 常用控制参数
- 表格右键扩展
- 表格扩展按钮
- 快速搜索
- 高级搜索(自定义视图)
- 表格注册事件
- 主从表格
- 可编辑表格
- 模块开发
- 开发案例
- 开发准则