HTML and CSS Reference
In-Depth Information
public function get_title( )
return 'Realtime Q&A';
* Loads and outputs the view's markup
* @return void
public function output_view( )
$view = new View('home');
As we discussed when building the abstract Controller class, the Home class extends Controller .
First—because the home page does not accept any arguments—the constructor is overridden to avoid an Exception .
Then get_title() is declared, which simply returns the name of the app for use in the <title> tag.
Finally, the output_view() method creates a new instance of the View class and calls its render() method to
output markup.
Next, let's create the home page markup and generate any necessary variables for output.
Creating the Home View
The markup for the home page will live in a file called , which should be created and saved in system/views/ .
Inside, add the home markup you created in Chapter 7 (the bits that need to be set by variables have been bolded):
<form id="attending" method="post"
action=" <?php echo $join_action; ?> ">
<p>Join a room using its ID.</p>
What is the room's ID?
<input type="text" name="room_id" />
<input type="submit" value="Join This Room" />
<input type="hidden" name="nonce"
value=" <?php echo $nonce; ?> " />
<form id="presenting" method="post"
action=" <?php echo $create_action; ?> ">
<p>Create a room to start your Q&amp;A session.</p>
Search WWH ::

Custom Search