本文整理汇总了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));
示例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);
}
}