当前位置: 首页>>代码示例>>PHP>>正文


PHP DataProvider::execute方法代码示例

本文整理汇总了PHP中DataProvider::execute方法的典型用法代码示例。如果您正苦于以下问题:PHP DataProvider::execute方法的具体用法?PHP DataProvider::execute怎么用?PHP DataProvider::execute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataProvider的用法示例。


在下文中一共展示了DataProvider::execute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render

 public function render()
 {
     $value = 0;
     $value_id = 0;
     $aDataSource = $this->getDataSource();
     $aDataSource[2]['Criteria']['ParentId'] = 0;
     $oDataProvider = new DataProvider($aDataSource);
     $oData = $oDataProvider->execute();
     //echo '<pre>', print_r($oData, true), '</pre>'; die();
     $aResult = array();
     $aResult[] = array('Name' => $this->getDefaultText(), 'Value' => $this->getDefaultValue());
     if ($this->getDefault()) {
         $aRs = array();
         if (preg_match("#:(.*?)#isU", $this->getDefault(), $aRs)) {
             $value = Toolkit::getInstance()->request->get($aRs[1], Request::C_GET);
         }
     }
     if ($this->getValue()) {
         $value_id = $this->getValue();
     }
     if ($oData->count() > 0) {
         $aResult = $this->getChilds($oData, 1, $aResult);
     }
     echo FormHelper::selectbox($this->getAlias(), $value_id, $aResult, array('class' => 'selectbox', 'id' => 'field_' . $this->getAlias()));
 }
开发者ID:ruxon,项目名称:module-ruxon,代码行数:25,代码来源:RuxonFormViewListTreeColumn.class.php

示例2: render

 public function render()
 {
     $value = 0;
     $value_id = 0;
     $aDataSource = $this->getDataSource();
     if ($this->getIsTree()) {
         $aDataSource[2]['Criteria']['ParentId'] = 0;
     }
     $oDataProvider = new DataProvider($aDataSource);
     $oData = $oDataProvider->execute();
     //echo '<pre>', print_r($oData, true), '</pre>'; die();
     $aResult = array();
     $aResult[] = array('Name' => $this->getDefaultText(), 'Value' => $this->getDefaultValue());
     if ($this->getDefault()) {
         $aRs = array();
         if (preg_match("#:(.*?)#isU", $this->getDefault(), $aRs)) {
             $value = Toolkit::getInstance()->request->get($aRs[1], Request::C_GET);
         }
     }
     if ($this->getValue()) {
         $value_id = $this->getValue();
     }
     $aResult = $this->createRow($oData, $aResult);
     if ($this->getOnChange()) {
         $tmpChange = $this->getOnChange();
         echo FormHelper::selectbox($this->getAlias(), $value_id, $aResult, array('class' => 'selectbox ajax_response_list', 'data-field' => $tmpChange[0], 'data-id' => $this->getValue(), 'id' => 'field_' . $this->getAlias()));
         //$.post('/structure/page_backend/typeParams', {Id: $this->getValue()}, function (data) { /* response */ });
     } else {
         echo FormHelper::selectbox($this->getAlias(), $value_id, $aResult, array('class' => 'selectbox', 'id' => 'field_' . $this->getAlias()));
     }
 }
开发者ID:ruxon,项目名称:module-ruxon,代码行数:31,代码来源:RuxonFormViewListColumn.class.php

示例3: render

 public function render()
 {
     $value = 0;
     $value_id = 0;
     $oDataProvider = new DataProvider($this->getDataSource());
     $oData = $oDataProvider->execute();
     //echo '<pre>', print_r($oData, true), '</pre>'; die();
     $aResult = array();
     /*$aResult[] = array(
           'Name' => $this->getDefaultText(),
           'Value' => $this->getDefaultValue()
       ); */
     if ($this->getDefault()) {
         $aRs = array();
         if (preg_match("#:(.*?)#isU", $this->getDefault(), $aRs)) {
             $value = Toolkit::getInstance()->request->get($aRs[1], Request::C_GET);
         }
     }
     //echo 'val:', print_r($this->getValue()->toSimpleArray(), true);
     if ($this->getValue()) {
         $value_id = $this->getValue()->toSimpleArray();
     }
     if ($oData->count() > 0) {
         foreach ($oData as $itm) {
             $getter = 'get' . $this->getValueField();
             $aResultTmp = array('Value' => call_user_func(array($itm, $getter)), 'Name' => $this->getTextFormat());
             $aRs = array();
             if (preg_match_all("/:(.*):/iU", $aResultTmp['Name'], $aRs)) {
                 foreach ($aRs[1] as $k => $val) {
                     $value = $itm;
                     if (strpos($val, "-") !== false) {
                         $xVal = explode("-", $val);
                         foreach ($xVal as $_val) {
                             $sGetter = 'get' . $_val;
                             $value = call_user_func(array($value, $sGetter));
                         }
                     } else {
                         $sGetter = 'get' . $val;
                         $value = call_user_func(array($value, $sGetter));
                     }
                     $aResultTmp['Name'] = str_replace($aRs[0][$k], $value, $aResultTmp['Name']);
                 }
             }
             /*if (isset($aContainer['IsTree']) && $aContainer['IsTree'] == true) {
             			$aResultTmp['Name'] = str_repeat(' |-- ', $itm->getTreeLevel() - 1).$aResultTmp['Name'];
             		}*/
             $aResult[] = $aResultTmp;
         }
     }
     $sResult = FormHelper::multiselect($this->getAlias() . '[]', $value_id, $aResult, array('class' => 'multiselect', 'id' => 'field_' . $this->getAlias()));
     if ($this->getExtended()) {
         $sResult .= '<script>$(document).ready(
             function()
             {
                 $(\'#field_' . $this->getAlias() . '\').multiselect({sortable: false, searchable: false});
             }
         );</script>';
     }
     echo $sResult;
 }
开发者ID:ruxon,项目名称:module-ruxon,代码行数:60,代码来源:RuxonFormViewMultiselectColumn.class.php


注:本文中的DataProvider::execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。