diff options
author | piernov <piernov@piernov.org> | 2016-04-24 22:05:25 +0200 |
---|---|---|
committer | piernov <piernov@piernov.org> | 2016-04-24 22:05:25 +0200 |
commit | 8a3610d9ac8349877b7a023a417288c2daee14ba (patch) | |
tree | 18c984dc08f4fce7753e7a33abe0de90147c5832 /inc | |
parent | 198eaff1fb3469e27318592c4b592e2f099f41a1 (diff) | |
download | candybox-8a3610d9ac8349877b7a023a417288c2daee14ba.tar.gz candybox-8a3610d9ac8349877b7a023a417288c2daee14ba.tar.bz2 candybox-8a3610d9ac8349877b7a023a417288c2daee14ba.tar.xz candybox-8a3610d9ac8349877b7a023a417288c2daee14ba.zip |
Add sendError() PHP error message helper
Diffstat (limited to 'inc')
-rw-r--r-- | inc/messages.inc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/inc/messages.inc b/inc/messages.inc new file mode 100644 index 0000000..f1ca8b3 --- /dev/null +++ b/inc/messages.inc @@ -0,0 +1,15 @@ +<?php + +$messages = array( + "shop_already_built" => "You have already built a shop.", + "gold_insufficient" => "You don't have enough gold.", + "shop_missing_item" => "This item does not exist.", +); + +function sendError($msg) { + global $messages; + $text = $messages[$msg]; + echo json_encode(array("error" => $text)); +} + +?> |