国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

? ??? ?? PHP ???? Yii ?????? ??? ?? ?? ?? ??

Yii ?????? ??? ?? ?? ?? ??

Jul 25, 2016 am 08:48 AM

'; foreach ($this->dataKey as $v) { if ($this->formatParam == $v) $str = '{$strSep}'; else $str = ''; $html 。 = ''; } $html .= ''; 回傳$html ; }
  • /**
  • * ??? ? ?? ????
  • * @return ???
  • */
  • ?? ?? getTableHead(){
  • $html = '
  • ';
  • foreach($this->tableHead as $v )
  • $html .= '
  • ';
  • $html .= '
  • ';
  • $html ?? ;
  • }
  • /**
  • * ??? ???? ?? ????
  • * @return ???
  • */
  • ?? ?? getTable() {
  • $this->strItem = $this->getItemName();
  • $strRe = '
  • ? ?? ??? ?? ?? ??, ??? ? ???? ?? ??? ?? ?? ??
    ??? ? ???? ??? ???? ??? ????, ???? ???? ???? ???? ?? ??? ????, ?? ??? ??? ??? ? ????. ???? ? ??? ?? ??? ? ??? ???? ?? ??? ?????.
    ? ?? ??? ???? ??? ? ????. ??? ??? ???? ?????... Yii ?????? ??? ?? ?? ?? ?? Yii ?????? ??? ?? ?? ?? ??
    1. ?? ???
    2. ??? ??? ??
    3. widget('ext.tree.widgets.TreeWidget',array(
    4. ' dataProvider' => $dataProvider, // ??? ??
    5. 'pid' => 'pid', // ?? ID ??
    6. 'tableClass' => ', // ??? ???
    7. 'formatParam' => 'name', // ???? ?? ??
    8. 'formatTime' => array( // ???? ?? ???? ??
    9. 'created'
    10. ),
    11. 'action' => array(
    12. array(
    13. 'label' => 'Edit', // ?? ??
    14. 'url' => array(
    15. 'edit') => 'Yii::app()->controller->createUrl("/manage/taosearch/createProduct")', // ?? ??
    16. ),
    17. 'urlParams' => 'id','name'), // URL ??? ????? ?? ???? ??? ?????.
    18. ),
    19. array(
    20. 'label' => 'Add', // ?? ??
    21. 'url' => array(
    22. 'add' => 'Yii::app()->controller->createUrl("/manage/taosearch/createProduct")', // ?? ??
    23. ??> ),
    24. 'urlParams' => array('id','name'), // URL ?? ????? ?? ???? ??? ?????
    25. ),
    26. ),
    27. 'tableHead' => array( // ??? ?? ?? ?? ??
    28. 'Category ID',
    29. 'Channel',
    30. '??? ??',
    31. '?? ??',
    32. '??? ??',
    33. '??',
    34. '????',
    35. '??ID',
    36. '????',
    37. '??',
    38. ),
    39. ) ); ?>
    40. ???? ?? ??
    41. widget('ext.tree.widgets.TreeWidget',array(
    42. 'dataProvider' => ; $cate, // ??? ??
    43. 'pid' => 'pid', // ?? ID ??
    44. 'formatParam' => 'name', // ?? ?? ??
    45. 'treeType' => ; false, // ?? ?? ??
    46. 'selectClass' => 'class="span11"', // ???? ?? ??? ??
    47. 'defaultSelectValue' => box
    48. ? ???? ??? 0, '1? ?? ?'
    49. ),
    50. )) ?>
    ?? ??
    ???? ?? ? ????.
  • ?? ??
    1. /*
    2. * ? ???? ????? ?? | ???
    3. * ????? ???? ???.
    4. */
    5. /**
    6. * ?? ??
    7. *
    8. * @author Wang Jiacheng
    9. * @email 819434425@qq.com
    10. *
    11. * ??? ?? ??, ?? ???
    12. ? ? ????. * * ??
    13. (
    14. 0 => ??
    15. (
    16. 'id' => '7'
    17. 'zone' => '??'
    18. '??' = > '??'
    19. 'ename' => '??'
    20. '? ??' => 'l'
    21. 'sort_order' => 1'
    22. 'pid' => '6'
    23. 'created' => '0'
    24. )
    25. )
    26. *
    27. * ??? ?? ??
    28. < ?php $this->widget('ext.tree.widgets.TreeWidget',array(
    29. 'dataProvider' => $dataProvider, // ??? ??
    30. 'pid' => 'pid', // ?? ID ??
    31. 'tableClass' => 'items table table-striped table-bordered table-densed', // ??? ???
    32. 'formatParam' => 'name', // ?? ?? ??
    33. ' formatTime' => array( // ???? ?? ???? ??
    34. 'created'
    35. ),
    36. 'action' => array(
    37. array(
    38. 'label' => 'Edit' , // ?? ??
    39. 'url' => array(
    40. 'edit' => 'Yii::app()->controller->createUrl( "/manage/taosearch/createProduct") ', // ?? ??
    41. ),
    42. 'urlParams' => array('id','name'), // URL ??? ????? ?? ???? ??? ?????
    43. ),
    44. array(
    45. 'label' => '??', // ?? ??
    46. 'url' => array(
    47. 'add' => 'Yii: :app()-> ;controller->createUrl("/manage/taosearch/createProduct")', // ?? ??
    48. ),
    49. 'urlParams' => array('id','name '), // url
    50. ),
    51. ),
    52. 'tableHead' => array( // ??? ? ?? ?? ??
    53. 'Category ID',
    54. ' ?? ????? ?? ???? ?? ??',
    55. '????',
    56. '????',
    57. '???',
    58. '??',
    59. '????',
    60. '??ID',
    61. '?? ??',
    62. '??',
    63. ),
    64. )) ?>
    65. *
    66. * ???? ?? ???? ??
    67. * < ?php $this->widget('ext.tree.widgets.TreeWidget',array(
    68. 'dataProvider' => $cate, // ??? ??
    69. 'pid' => 'pid', // ?? ID ??
    70. 'formatParam' => 'name', // ?? ?? ??
    71. 'treeType' => false, // ?? ?? ??
    72. 'selectClass' => ' class="span11 "', // ???? ??? ??? ??
    73. 'defaultSelectValue' => array( // ???? ??? ???? ?? ??
    74. 0, 1?? 'EMA ? ?'
    75. ),
    76. )) ?>
    77. */
    78. class TreeWidget ?? ?? {
    79. /**
    80. * CArrayDataProvider ??? ?? ?? ?? ???
    81. * ????? ???? ???? ???(?? ??)
    82. * @var ?? ??
    83. * /
    84. ?? $dataProvider;
    85. /**
    86. * ??? ?? ??
    87. * @var type
    88. */
    89. ?? $arrAll = array();
    90. /**
    91. * ? ??? _ID? ??? ??
    92. * @var ??
    93. */
    94. public $arrIdRelation = array();
    95. /**
    96. * _ID? ? ???? ???? ??? ?? ???, ?? ????? ??? ??
    97. * @var ??
    98. */
    99. public $arrIdRelationSimple = array();
    100. /**
    101. * ?? ???? ? ??? _ID? ??? ?????.
    102. * @var type
    103. */
    104. public $arrIdAll = array();
    105. /**
    106. * ?? ??-?? ??
    107. * @var ??
    108. */
    109. public $arrIdSon = array();
    110. /**
    111. * ?? ??? _ID
    112. * @var ??
    113. */
    114. ?? $arrIdLeaf = array();
    115. /**
    116. *?? ??? _ID
    117. * @var ??
    118. */
    119. ?? $arrIdRoot = array();
    120. /**
    121. * 每個(gè)節(jié)點(diǎn)下的子孫后代_ID
    122. * @var type
    123. */
    124. public $arrIdChildren = array();
    125. /**
    126. * 每個(gè)節(jié)點(diǎn)回逆到根
    127. * @var type
    128. */
    129. public $arrIdBackPath = array();
    130. > /**
    131. * 輸出樹的結(jié)構(gòu)
    132. * @var type
    133. */
    134. public $strItem = '
      gt;{$strSep}{$name}';
    135. /**
    136. * 設(shè)定表格樣式
    137. * @var type
    138. */
    139. public $tableClass = 'items table table-striped table-bordered table-condensed';
    140. /**
    141. * 資料欄位參數(shù)陣列
    142. * @var type
    143. */
    144. public $dataKey = array();
    145. / **
    146. * 指定需要格式化的欄位
    147. * @var type
    148. */
    149. public $formatParam = 'name';
    150. /**
    151. * 表格列名稱
    152. * @var type
    153. */
    154. public $tableHead = array();
    155. / **
    156. * 父 ID
    157. * @var 型態(tài)
    158. */
    159. public $pid = 'pid';
    160. /**
    161. * 指定樹的類型
    162. * true 表格類型樹
    163. * false 下拉框類型樹
    164. * @var type
    165. */
    166. public $treeType = true;
    167. /**
    168. * 綁定下拉框value值
    169. * @var type
    170. */
    171. public $optionValue = 'id';
    172. /**
    173. * 格式化時(shí)間
    174. * @var type
    175. */
    176. public $formatTime = array();
    177. /**
    178. * 下拉框樣式
    179. * @var type
    180. */
    181. public $selectClass = 'class="span3"';
    182. /**
    183. * 設(shè)定下拉框的預(yù)設(shè)值和選項(xiàng)
    184. * @var type
    185. */
    186. public $defaultSelectValue = array(
    187. 0,'≡作為一級(jí)欄目≡',
    188. );
    189. /**
    190. * 設(shè)定下拉框是否多選
    191. * true 多選
    192. * false 單選
    193. * @var type
    194. */
    195. public $isMultiple = false;
    196. * 綁定到下拉框的預(yù)設(shè)值
    197. * @var type
    198. */
    199. public $isMultiple = false;
    200. /**
    201. * 操作列
    202. * @var type
    203. */
    204. public $bindSelectValue = 0;
    205. /**
    206. * 運(yùn)行
    207. */
    208. public $action = array();
    209. /**
    210. * 運(yùn)行
    211. * @param 型態(tài) $datas
    212. * @return 型別
    213. */
    214. public function run() {
    215. if (is_array($this->dataProvider) && count($this->dataProvider) > 0 )
    216. $data = $this->_run($this->dataProvider);
    217. else if (is_object($this->dataProvider) && count($this->dataProvider->rawData) > 0)
    218. $data = $this->_run($this->dataProvider->rawData);
    219. $this->render('tree' , array('data'=>$data));
    220. }
    221. /**
    222. * 取得html
    223. * @return type
    224. * @param type $datas
    225. * @return 類型
    226. */
    227. private function _run($datas){
    228. foreach ($datas as $data) {
    229. if (!empty($this ->動(dòng)作) && count($this->action) > 0) {
    230. foreach ($this->action as $key => $action) {
    231. $k = array_keys($ action['url']) ;
    232. $data[$k[0]] = '';
    233. }
    234. }
    235. $this->arrAll[] = $data;
    236. $this->dataKey = array_keys( $數(shù)據(jù));
    237. }
    238. $this->processData();
    239. if ($this->treeType === true)
    240. $data = $this->getTable ();
    241. else
    242. $data = $this->getSelect($this->pid, $this->bindSelectValue, $this->isMultiple, $this->selectClass, $this ->defaultSelectValue);
    243. return $data;
    244. }
    245. /**
    246. * 設(shè)定分層欄位
    247. * 表格類型
    248. * @return string
    249. */
    250. public function getHtml() { return $this->genHtml(); /***/ public function getItemName(){ $html = '
  • '.$str.'{$'.$v.'}
    '.$v.'
    ';
  • $strRe .= '
  • '.$this->getTableHead().'< ;/thead>';
  • $strRe .= $this->genHtml();
  • $strRe .= '
  • ';
  • return $strRe;
  • }
  • /**
  • * ???? ?? ??? ?? ????
  • * @param type $strName
  • * @param array $arrValue
  • * @param type $blmMulti
  • * @param type $ strExt
  • * @param ?? $arrFirst
  • * @return ???
  • */
  • ?? ?? getSelect($strName = 'tree', $arrValue = array(), $blmMulti = false, $strExt = '', $arrFirst = null) {
  • !is_array($arrValue) && $arrValue = array($arrValue);
  • foreach ($this->arrIdAll as $strTemp => $arrTemp) {
  • $this->arrIdAll[$strTemp]['selected'] = '';
  • if (in_array($arrTemp['id'], $arrValue)) {
  • $this->arrIdAll[$strTemp]['selected'] = ' selected="selected"';
  • }
  • }
  • $this->strItem = 'optionValue.'}"{$selected} title="{$'.$this->formatParam.'}">{$strSep}{$'.$this-> ;formatParam.'}';
  • $strRe = '