當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ArrayUtils::GetArrayValueDef方法代碼示例

本文整理匯總了PHP中ArrayUtils::GetArrayValueDef方法的典型用法代碼示例。如果您正苦於以下問題:PHP ArrayUtils::GetArrayValueDef方法的具體用法?PHP ArrayUtils::GetArrayValueDef怎麽用?PHP ArrayUtils::GetArrayValueDef使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ArrayUtils的用法示例。


在下文中一共展示了ArrayUtils::GetArrayValueDef方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: RenderGrid

 public function RenderGrid(Grid $Grid)
 {
     $Grid->GetDataset()->Open();
     $totals = array();
     if ($Grid->HasTotals()) {
         $totalValues = $Grid->GetTotalValues();
         foreach ($Grid->GetPrintColumns() as $column) {
             $totals[] = $column->GetTotalPresentationData(ArrayUtils::GetArrayValueDef($totalValues, $column->GetName(), null));
         }
     }
     $this->doRenderGrid($Grid, PageMode::PrintAll, 'print/grid.tpl', array('Totals' => $totals));
 }
開發者ID:martinw0102,項目名稱:ProjetSyst,代碼行數:12,代碼來源:print_renderer.php

示例2: RenderGrid

 function RenderGrid(Grid $Grid)
 {
     $Rows = array();
     $Grid->GetDataset()->Open();
     while ($Grid->GetDataset()->Next()) {
         $rowValues = $Grid->GetDataset()->GetCurrentFieldValues();
         $Rows[] = Q::ToArray(Q::Select($Grid->GetPrintColumns(), Q::L('$c => $_1->RenderViewColumn($c, $_2)', $this, $rowValues)));
     }
     $totals = array();
     if ($Grid->HasTotals()) {
         $totalValues = $Grid->GetTotalValues();
         foreach ($Grid->GetPrintColumns() as $column) {
             $totals[] = $column->GetTotalPresentationData(ArrayUtils::GetArrayValueDef($totalValues, $column->GetName(), null));
         }
     }
     $this->DisplayTemplate('print/grid.tpl', array('Grid' => $Grid), array('Columns' => $Grid->GetPrintColumns(), 'Rows' => $Rows, 'Totals' => $totals));
 }
開發者ID:howareyoucolin,項目名稱:demo,代碼行數:17,代碼來源:print_renderer.php

示例3: GetAggregateFor

 /**
  * @param CustomViewColumn $column
  * @return Aggregate
  */
 public function GetAggregateFor(CustomViewColumn $column)
 {
     return ArrayUtils::GetArrayValueDef($this->totals, $column->GetName());
 }
開發者ID:howareyoucolin,項目名稱:demo,代碼行數:8,代碼來源:grid.php

示例4: RenderGrid

 function RenderGrid(Grid $Grid)
 {
     $Rows = array();
     $HeaderCaptions = array();
     $Grid->GetDataset()->Open();
     foreach ($Grid->GetExportColumns() as $Column) {
         $HeaderCaptions[] = $Column->GetCaption();
     }
     while ($Grid->GetDataset()->Next()) {
         $Row = array();
         $rowValues = $Grid->GetDataset()->GetFieldValues();
         $cellStyles = $this->GetStylesForColumn($Grid, $rowValues);
         foreach ($Grid->GetExportColumns() as $column) {
             $columnName = $Grid->GetColumnName($column);
             $cell['Value'] = $this->RenderViewColumn($column, $rowValues);
             $cell['Align'] = $column->GetAlign();
             $cellStyle = new StyleBuilder();
             $cellStyle->Add('width', $column->GetFixedWidth());
             if (!$column->GetWordWrap()) {
                 $cellStyle->Add('white-space', 'nowrap');
             }
             $cellStyle->AddStyleString(ArrayUtils::GetArrayValueDef($cellStyles, $columnName));
             $cell['Style'] = $cellStyle->GetStyleString();
             $Row[] = $cell;
         }
         $Rows[] = $Row;
     }
     $this->DisplayTemplate('export/pdf_grid.tpl', array(), array('TableHeader' => $this->CreateTableHeaderData($Grid), 'Rows' => $Rows));
 }
開發者ID:outsourcinggithub,項目名稱:outsourcing,代碼行數:29,代碼來源:pdf_renderer.php

示例5: GetMasterFieldValueByName

 public function GetMasterFieldValueByName($fieldName)
 {
     return ArrayUtils::GetArrayValueDef($this->masterFieldValue, $fieldName);
 }
開發者ID:martinw0102,項目名稱:ProjetSyst,代碼行數:4,代碼來源:dataset.php

示例6: RenderGrid


//.........這裏部分代碼省略.........
             while($Grid->GetDataset()->Next())
             {
                 $show = true;
                 $Grid->BeforeShowRecord->Fire(array(&$show));
                 if (!$show)
                     continue;
     
                 $Row = array();
                 $AfterRowControls = '';
     
                 $rowValues = $Grid->GetDataset()->GetFieldValues();
                 $rowCssStyle = '';
                 $cellCssStyles = array();
     
                 $Grid->OnCustomDrawCell->Fire(array($rowValues, &$cellCssStyles, &$rowCssStyle));
                 $cellCssStyles_Simple = $this->GetStylesForColumn($Grid, $rowValues);
                 $cellCssStyles = array_merge($cellCssStyles_Simple, $cellCssStyles);
     
                 $currentRowColumnsCssStyles = array();
     
                 $columnsChars = array();
                 for($i = 0; $i < count($bands); $i++)
                 {
                     $band = $bands[$i];
     
                     foreach($band->GetColumns() as $Column)
                     {
                         $columnName = $Grid->GetDataset()->IsLookupField($Column->GetName()) ?
                             $Grid->GetDataset()->IsLookupFieldNameByDisplayFieldName($Column->GetName()) :
                             $Column->GetName();
     
     
                         if (array_key_exists($columnName, $cellCssStyles))
                         {
                             $styleBuilder = new StyleBuilder();
                             $styleBuilder->AddStyleString($rowCssStyle);
                             $styleBuilder->AddStyleString($cellCssStyles[$columnName]);
                             $currentRowColumnsCssStyles[] = $styleBuilder->GetStyleString();
                         }
                         else
                             $currentRowColumnsCssStyles[] = $rowCssStyle;
     
                         if ($Column->GetFixedWidth() != null)
                             $currentRowColumnsCssStyles[count($currentRowColumnsCssStyles) - 1] .=  sprintf('width: %s;', $Column->GetFixedWidth());
                         if (!$Column->GetWordWrap())
                             $currentRowColumnsCssStyles[count($currentRowColumnsCssStyles) - 1] .=  sprintf('white-space: nowrap;', $Column->GetFixedWidth());
     
     
                         $columnRenderResult = '';
                         $customRenderColumnHandled = false;
                         $Grid->OnCustomRenderColumn->Fire(array($columnName, $Column->GetData(), $rowValues, &$columnRenderResult, &$customRenderColumnHandled));
                         $columnRenderResult = $customRenderColumnHandled ? $Grid->GetPage()->RenderText($columnRenderResult) : $this->Render($Column);
                         $Row[] = $columnRenderResult;
                         $columnsChars[] = ($Column->IsDataColumn() ? 'data' : 'misc');
     
                         $afterRow = $Column->GetAfterRowControl();
                         if (isset($afterRow))
                             $AfterRowControls .= $this->Render($afterRow);
                     }
     
                     if ($i < (count($bands) - 1))
                         $currentRowColumnsCssStyles[count($currentRowColumnsCssStyles) - 1] .= ($Grid->GetPage()->GetPageDirection() == 'rtl' ? 'border-left: ' : 'border-right: ' ). 'solid 2px' . ' #000000;';
                 }
                 $recordCount++;
                 if ($Grid->GetAllowDeleteSelected())
                     $RowPrimaryKeys[] = $Grid->GetDataset()->GetPrimaryKeyValues();
                 $Rows[] = $Row;
                 $AfterRows[] = $AfterRowControls;
                 $rowCssStyles[] = $rowCssStyle;
                 $rowColumnsCssStyles[] = $currentRowColumnsCssStyles;
                 $rowColumnsChars[] = $columnsChars;
             }
     */
     $Rows = array();
     $HeaderCaptions = array();
     $Grid->GetDataset()->Open();
     foreach ($Grid->GetExportColumns() as $Column) {
         $HeaderCaptions[] = $Column->GetCaption();
     }
     while ($Grid->GetDataset()->Next()) {
         $Row = array();
         $rowValues = $Grid->GetDataset()->GetFieldValues();
         $cellStyles = $this->GetStylesForColumn($Grid, $rowValues);
         foreach ($Grid->GetExportColumns() as $column) {
             $columnName = $Grid->GetDataset()->IsLookupField($column->GetName()) ? $Grid->GetDataset()->IsLookupFieldNameByDisplayFieldName($column->GetName()) : $column->GetName();
             $cell['Value'] = $this->RenderViewColumn($column, $rowValues);
             $cell['Align'] = $column->GetAlign();
             $cellStyle = new StyleBuilder();
             $cellStyle->Add('width', $column->GetFixedWidth());
             if (!$column->GetWordWrap()) {
                 $cellStyle->Add('white-space', 'nowrap');
             }
             $cellStyle->AddStyleString(ArrayUtils::GetArrayValueDef($cellStyles, $columnName));
             $cell['Style'] = $cellStyle->GetStyleString();
             $Row[] = $cell;
         }
         $Rows[] = $Row;
     }
     $this->DisplayTemplate('export/pdf_grid.tpl', array(), array('TableHeader' => $this->CreateTableHeaderData($Grid), 'Rows' => $Rows));
 }
開發者ID:blakeHelm,項目名稱:BallotPath,代碼行數:101,代碼來源:pdf_renderer.php


注:本文中的ArrayUtils::GetArrayValueDef方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。