本文整理汇总了PHP中JsonResponse::unsuccessful方法的典型用法代码示例。如果您正苦于以下问题:PHP JsonResponse::unsuccessful方法的具体用法?PHP JsonResponse::unsuccessful怎么用?PHP JsonResponse::unsuccessful使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JsonResponse
的用法示例。
在下文中一共展示了JsonResponse::unsuccessful方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
});
$app->get("/thankyou/", function () use($app) {
$app->render("template.php", array("view" => "thankyou.html"));
});
$app->get("/thankyou2/", function () use($app) {
$app->render("template.php", array("view" => "thankyou2.html"));
});
$app->get("/events/pokerrun/", function () use($app) {
$app->render("template.php", array("view" => "pokerrun.html"));
});
$app->post("/pokerrun/", function () use($app) {
$data = $_POST["data"];
$response = new JsonResponse();
$response->successful("Successfully created a new request for poker run.", $data);
});
$app->post("/contact/", function () use($app) {
$response = new JsonResponse();
$contact = new Contact();
$result = $contact->sendContactEmail($_POST['name'], $_POST['email'], $_POST['phone'], $_POST['message']);
if (result) {
$response->successful("Message successfully sent. Thank you for contacting Waterfowlers for Warriors.", $result);
} else {
$response->unsuccessful("Failed to send message. Please try again later.", $result);
}
});
$app->post('/profile/', function () use($app) {
$profile = new Profile();
$profile->saveProfile($_POST);
$app->render("template.php", array("view" => "thankyou2.html"));
});
$app->run();