/mvc/elements/account/signup
[return to app]1
<?php
2 if (!isset($loginAction)) {
3 $loginAction = get::url(array('ssl' => true, 'get' => true));
4 } else if (strpos($loginAction, 'signup=true') === false) {
5 $loginAction .= (strpos($loginAction, '?') !== false ? '&' : '?') . 'signup=true';
6 }
7 echo $form->open(array('action' => $loginAction, 'id' => 'signupform'));
8
9 $url = str_replace(array('?signup=true', '&signup=true'), '', get::url(array('get' => true)));
10 echo $html->div($html->link(($url ? $url : '/'), 'Existing user log in'));
11
12 if (isset($_POST['errors']['signup'])) {
13 echo $form->getErrorMessageContainer('email', $_POST['errors']['signup']);
14 }
15 $args = array('name' => 'signup_name', 'label' => 'Name', 'id' => 'signupname', 'addBreak' => false);
16 echo $html->div($form->input($args));
17 $args = array('name' => 'signup_email', 'label' => 'Email', 'id' => 'signupemail', 'addBreak' => false);
18 echo $html->div($form->input($args));
19 echo $form->submit('Sign up');
20 echo $form->close();