Create mobileswitcher.php

This commit is contained in:
Namhyeon Go 2019-04-29 02:47:15 +09:00 committed by GitHub
parent 53ac08b647
commit 75963a89e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

23
route/mobileswitcher.php Normal file
View File

@ -0,0 +1,23 @@
<?php
loadHelper("mobiletool");
$from = get_requested_value("from");
$redirect_url = get_requested_value("redirect_url");
$dm = detect_mobile();
if($from == "pc") {
$dm = 1;
} elseif($from == "mobile") {
$dm = 0;
}
$data = array(
"from" => $from,
"dm" => $dm,
"redirect_url" => get_final_link($redirect_url, array(
"action" => "mobileswitcher",
"dm" => $dm,
)),
);
renderView("view_mobileswitcher", $data);