public function AnswersCountViewsHandler::render in Answers 7.4
Render the field.
Parameters
bool $empty: There is no values .
Overrides views_handler_area::render
File
- ./
answers_views_handler_answers_count.inc, line 21 - Definition of views_handler_area_result.
Class
- AnswersCountViewsHandler
- Views area handler to display answers count.
Code
public function render($empty = FALSE) {
$output = '';
$count = count($this->view->result);
$total = isset($this->view->total_rows) ? $this->view->total_rows : count($this->view->result);
switch ($total) {
case 0:
return t('No !Answers yet.', answers_translation());
case 1:
return t('1 !Answer', answers_translation());
default:
return $total . ' ' . t('!Answers', answers_translation());
}
}