HTML and CSS Reference
In-Depth Information
Tell us your name (so attendees know who you are).
<input type="text" name="presenter-name" />
</label>
<label>
Tell us your email (so attendees can get in touch with you).
<input type="email" name="presenter-email" />
</label>
<label>
What is your session called?
<input type="text" name="session-name" />
</label>
<input type="submit" value="Create Your Room" />
<input type="hidden" name="nonce"
value="
<?php echo $nonce; ?>
" />
</form><!--/#presenting-->
</section>
This view requires three variables:
•
$join_action
: The form action that will allow a user to join an existing room
•
$nonce
: A security token that prevents the form from being submitted fraudulently or
repeatedly
$create_action
: The form action that allows a user to create a new room
The
$nonce
is used in both forms because there's no way for both forms to be submitted simultaneously (and
even if there were, that's not a behavior this app supports).
•
Generating Variables for Output
To create the variables for outputting the home view, go back into the Home controller (
class.home.inc.php
) and
add the following bold code:
/**
* Loads and outputs the view's markup
*
* @return void
*/
public function output_view( )
{
$view = new View('home');
$view->nonce = $this->generate_nonce();
// Action URIs for form submissions
$view->join_action = APP_URI . 'room/join';
$view->create_action = APP_URI . 'room/create';
$view->render();
}
Search WWH ::
Custom Search