當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Place::setMeetupLocation方法代碼示例

本文整理匯總了PHP中Place::setMeetupLocation方法的典型用法代碼示例。如果您正苦於以下問題:PHP Place::setMeetupLocation方法的具體用法?PHP Place::setMeetupLocation怎麽用?PHP Place::setMeetupLocation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Place的用法示例。


在下文中一共展示了Place::setMeetupLocation方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: function

    return $app['twig']->render('login.html.twig');
});
$app->get("/logged_on", function () use($app) {
    $user_name = $_GET['username'];
    $user = User::findByUserName($user_name);
    $user_logged = $user->logIn($user_name, $_GET['password']);
    if ($user_logged == "Wrong Password") {
        return $app['twig']->render('login.html.twig');
    } else {
        return $app['twig']->render('users.html.twig', array('user' => $user_logged, 'avialable_users' => $user->findUsersNear(), 'requests' => $user->findMeetupRequests()));
    }
});
$app->post("/request_meetup", function () use($app) {
    $user1 = User::find($_POST['user1_id']);
    $user2 = User::find($_POST['user2_id']);
    $location = Place::setMeetupLocation($user1, $user2);
    $user1->addMeetUpRequest($user2->getId(), $location->getId());
    return $app['twig']->render('waiting_to_confirm.html.twig', array('user1_id' => $user1->getId(), 'user2_id' => $user2->getId()));
});
//waiting for request respond page
$app->get("/wait_for_confirmation", function () use($app) {
    $user1 = User::find($_GET['user1_id']);
    $user2 = User::find($_GET['user2_id']);
    if ($user1->hasUserTwoConfirmed($user2->getId()) == NULL) {
        return $app['twig']->render('waiting_to_confirm.html.twig', array('user1_id' => $user1->getId(), 'user2_id' => $user2->getId()));
    } else {
        if ($user1->hasUserTwoConfirmed($user2->getId())) {
            $location = Place::getMeetUpLocation($user1->getId(), $user2->getId());
            return $app['twig']->render('confirmed_user1.html.twig', array('user_to_meet' => $user2, 'user' => $user1, 'location' => $location));
        } else {
            return $app['twig']->render('rejected.html.twig', array('user' => $user1, 'user_to_meet' => $user2));
開發者ID:juliocesardiaz,項目名稱:Face2Face,代碼行數:31,代碼來源:app.php

示例2: setMeetupLocation

 static function setMeetupLocation($user1, $user2)
 {
     $temp_location = Place::generateLocation();
     if ($temp_location->verifyLocation($user1, $user2)) {
         return $temp_location;
     } else {
         Place::setMeetupLocation($user1, $user2);
     }
 }
開發者ID:juliocesardiaz,項目名稱:Face2Face,代碼行數:9,代碼來源:Place.php


注:本文中的Place::setMeetupLocation方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。