本文整理匯總了PHP中Q::ToArray方法的典型用法代碼示例。如果您正苦於以下問題:PHP Q::ToArray方法的具體用法?PHP Q::ToArray怎麽用?PHP Q::ToArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Q
的用法示例。
在下文中一共展示了Q::ToArray方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: doRenderGrid
protected function doRenderGrid(Grid $Grid, $pageMode, $templatePath, $customParams = array())
{
$Rows = array();
while ($Grid->GetDataset()->Next()) {
$rowValues = $Grid->GetDataset()->GetCurrentFieldValues();
$Rows[] = Q::ToArray(Q::Select($Grid->GetPrintColumns(), Q::L('$c => $_1->RenderViewColumn($c, $_2)', $this, $rowValues)));
}
$template = $Grid->GetPage()->GetCustomTemplate(PagePart::Grid, $pageMode, $templatePath, $customParams);
$this->DisplayTemplate($template, array('Grid' => $Grid), array_merge($customParams, array('Columns' => $Grid->GetPrintColumns(), 'Rows' => $Rows)));
}
示例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));
}