function views_pdf_handler_page_break::render in Views PDF 7.2
Same name and namespace in other branches
- 6 field_plugins/views_pdf_handler_page_break.inc \views_pdf_handler_page_break::render()
- 7.3 field_plugins/views_pdf_handler_page_break.inc \views_pdf_handler_page_break::render()
- 7 field_plugins/views_pdf_handler_page_break.inc \views_pdf_handler_page_break::render()
This method renders the page break. It uses the PDF class to add a page break.
Overrides views_handler_field::render
File
- handlers/
views_pdf_handler_page_break.inc, line 69 - The page break plugin for PDF page display.
Class
- views_pdf_handler_page_break
- Plugin class that holds the functionality for the page break in a PDF display.
Code
function render($values) {
if (isset($this->view->pdf) && is_object($this->view->pdf)) {
if ($this->options['last_row'] == TRUE && $this->countRecords + 1 >= $this->view->total_rows) {
return '';
}
$this->countRecords++;
if ($this->countRecords == $this->view->total_rows + 1) {
$this->countRecords = 1;
}
$output = '';
if ($this->countRecords % $this->options['every_nth'] == 0) {
$output .= '<br pagebreak="true" />';
}
else {
$output .= '';
}
return $output;
}
}