HTML and CSS Reference
In-Depth Information
public function __construct( $options )
{
parent::__construct($options);
$this->room_id = isset($options[0]) ? (int) $options[0] : 0;
if ($this->room_id===0) {
throw new Exception("Invalid room ID supplied");
}
}
/**
* Generates the title of the page
*
* @return string The title of the page
*/
public function get_title( )
{
// Questions can't be called directly, so this is unused
return NULL;
}
/**
* Loads and outputs the view's markup
*
* @return string The HTML markup to display the view
*/
public function output_view( )
{
$questions = $this->get_questions();
$output = NULL;
foreach ($questions as $question) {
/*
* Questions have their own view type, so this section initializes
* and sets up variables for the question view
*/
$view = new View('question');
$view->question = $question->question;
$view->room_id = $this->room_id;
$view->question_id = $question->question_id;
$view->vote_count = $question->vote_count;
if ($question->is_answered==1) {
$view->answered_class = 'answered';
} else {
$view->answered_class = NULL;
}
Search WWH ::




Custom Search