本文整理汇总了PHP中ZendT_Lib::getTableDesc方法的典型用法代码示例。如果您正苦于以下问题:PHP ZendT_Lib::getTableDesc方法的具体用法?PHP ZendT_Lib::getTableDesc怎么用?PHP ZendT_Lib::getTableDesc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZendT_Lib
的用法示例。
在下文中一共展示了ZendT_Lib::getTableDesc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: configReportSample
//.........这里部分代码省略.........
$options['title'] = new ZendT_Report_Cell($options['title']);
$options['title']->setStyleName('title');
}
if (is_array($options['footer'])) {
$options['footer'] = new ZendT_Report_Cell($options['footer']);
$options['footer']->setStyleName('footer');
}
/**
* Tratamento para buscar os dados no banco de dados
*/
$postData = $this->getRequest()->getParams();
$postData['page'] = false;
$postData['count'] = false;
$whereGroup = $this->getWherePostData();
$mapperView = get_class($this->_mapper);
$logReport = new ZendT_Log_Report($mapperView, $title);
if ($this->_mapper instanceof ZendT_Db_View) {
$dataGrid = $this->getMapper()->getDataGrid($whereGroup, $postData);
} else {
$dataGrid = $this->getModel()->getDataGrid($whereGroup, $postData);
}
$logReport->finishDb();
/**
* Instancia do objeto de relat�rio
*/
$report = ZendT_Report::factory($type, $options);
$report->addPage();
/**
* Configuração da coluna de título
*/
$celulas = array();
foreach ($this->getColumns() as $column) {
if (!$column->getHidden()) {
$key = $column->getName();
$celulas[$key] = new ZendT_Report_Cell($options['cellsTitle']);
$celulas[$key]->setTextAlign($column->getAlign())->setWidth($column->getWidth())->setValue($column->getHeaderTitle());
$celulas[$key]->setStyleName('cellsTitle-' . $key);
$report->addCell($celulas[$key]);
}
}
$report->printCells();
/**
* Impressão dos registros detalhe
*/
$callStylesRow = method_exists($this->getMapper(), 'getStylesRow');
$celulas = array();
$numRows = 0;
while ($row = $dataGrid->getRow()) {
$stylesRow = array();
if ($callStylesRow) {
$stylesRow = $this->getMapper()->getStylesRow($row);
}
foreach ($this->getColumns() as $column) {
if (!$column->getHidden()) {
$key = $column->getName();
$cellOptions = $column->getOptions();
if ($dataGrid->getType()) {
$value = $row[strtolower($key)];
$type = $value->getType();
if (isset($cellOptions['expandTree'])) {
$newValue = $value->get();
$newValue = str_repeat(' ', $row['tree_level']->toPhp() * 4) . $newValue;
$value->set($newValue);
}
} elseif ($dataGrid->isRowFormated()) {
$value = $row[strtolower($key)];
$type = $column->getSorttype();
} else {
$value = $column->format($row[strtolower($key)]);
$type = $column->getSorttype();
}
$celName = $key;
if (isset($stylesRow[$key])) {
if (!$stylesRow[$key]['suffix']) {
$stylesRow[$key]['suffix'] = 'plus';
}
$celName .= '-' . $stylesRow[$key]['suffix'];
}
if (!isset($celulas[$celName])) {
$celulas[$celName] = new ZendT_Report_Cell($options['default']);
$celulas[$celName]->setTextAlign($column->getAlign())->setWidth($column->getWidth())->setType($type);
$celulas[$celName]->setStyleName('default-' . $celName);
if (isset($stylesRow[$key])) {
$celulas[$celName]->setStyles($stylesRow[$key]);
}
}
$celulas[$celName]->setValue($value);
$report->addCell($celulas[$celName]);
}
}
$report->printCells();
$numRows++;
}
/**
* Impressão/Saída do relatório
*/
$result = array('name' => str_replace(' ', '-', $title), 'content' => $report->output(ZendT_Lib::getTableDesc(), 'S'));
$logReport->finish($numRows);
return $result;
}