本文整理汇总了PHP中Q::Select方法的典型用法代码示例。如果您正苦于以下问题:PHP Q::Select方法的具体用法?PHP Q::Select怎么用?PHP Q::Select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q
的用法示例。
在下文中一共展示了Q::Select方法的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));
}