Example #1
0
 /**
  * @route * /member/signin(/error)?
  */
 public function login($matches, $callback)
 {
     $login = FW::param('login');
     $password = FW::param('password');
     if (isset($_POST['login']) && isset($_POST['password'])) {
         if ($login == 'sample' && $password == 'sample') {
             @session_start();
             $_SESSION['member'] = true;
             header('Location: ' . FW::baseUrl() . '/index.php/member');
         } else {
             header('Location: ' . FW::baseUrl() . '/index.php/member/signin/error');
         }
         return false;
     }
     $error = isset($matches[1]);
     echo FW::render('layouts/member', 'member/signin', array('login' => $login, 'password' => $password, 'error' => $error));
 }
Example #2
0
 /**
  * @route POST /contact
  */
 public function postContact()
 {
     $name = FW::param('name');
     $message = FW::param('message');
     echo FW::render('layouts/public', 'public/contact', array('name' => $name, 'message' => $message));
 }