本文整理匯總了PHP中Misc::arrayKeyMerge方法的典型用法代碼示例。如果您正苦於以下問題:PHP Misc::arrayKeyMerge方法的具體用法?PHP Misc::arrayKeyMerge怎麽用?PHP Misc::arrayKeyMerge使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Misc
的用法示例。
在下文中一共展示了Misc::arrayKeyMerge方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: AdminSmarty
<?php
require_once $_SERVER["DOCUMENT_ROOT"] . "/php/init.php";
Security::demand(EDITOR);
$smarty = new AdminSmarty();
$opt_kommun = Misc::arrayKeyMerge(array("" => "Välj..."), Kommun::listNamn());
$smarty->assign("opt_kommun", $opt_kommun);
if (!empty($_GET["id"])) {
$mal = Mal::loadById($_GET["id"]);
$kommun = $mal->getKommun();
$malId = $mal->getId();
$sel_kommun = $kommun->getId();
$smarty->assign("mal", $mal);
$smarty->assign("malId", $malId);
$smarty->assign("kommun", $kommun);
$smarty->assign("sel_kommun", $sel_kommun);
} else {
$smarty->assign("kommunId", null);
}
$smarty->display('mal.tpl');
示例2: array
$medlem = $USER;
if (!empty($_GET["id"])) {
$smarty->assign("notown", "true");
}
$smarty->assign("medlem", $medlem);
if (isset($_GET["ajax"])) {
$smarty->noShowHeaderFooter();
$smarty->assign("ajax", true);
} else {
$smarty->assign("ajax", false);
}
$stegtotal = $USER->getStegTotal();
$kmTotal = Steg::stegToKm($stegtotal);
if ($stegtotal == 0) {
$smarty->assign('firstrun', true);
$opt_kommuner = Misc::arrayKeyMerge(array("" => "Välj..."), Kommun::listNamn(false, false));
$op_namn = array();
$op_id = array();
foreach ($opt_kommuner as $key => $value) {
$op_namn[] = $value;
$op_id[] = $key;
}
$smarty->assign('op_namn', $op_namn);
$smarty->assign('op_id', $op_id);
$rutt = new Rutt($medlem);
} else {
}
$rutt = new Rutt($medlem);
$rutten = $rutt->getRutt();
$currentKommun = $medlem->getCurrentKommun();
$kommunnamn = Kommun::listNamn();
示例3: MMSmarty
<?php
require_once $_SERVER["DOCUMENT_ROOT"] . "/php/init.php";
Security::demand(USER);
$smarty = new MMSmarty();
$smarty->assign("pagetitle", "Rapport");
$malManager = new MalManager($USER);
$smarty->assign("malManager", $malManager);
$malList = $malManager->listMal();
$opt_mal = Misc::arrayKeyMerge(array("" => "Välj..."), $malManager->listAvalibleNamn());
$smarty->assign("opt_mal", $opt_mal);
$currentMal = $malManager->getCurrentMal();
$smarty->assign("currentMal", $currentMal);
$smarty->display('rapportmal.tpl');
示例4: MMSmarty
<?php
include $_SERVER["DOCUMENT_ROOT"] . "/php/init.php";
$smarty = new MMSmarty();
$smarty->assign("pagetitle", "Steg");
if (!empty($_GET["sid"])) {
$steg = Steg::loadById($_GET["sid"]);
$smarty->assign("steg", $steg);
}
if (!isset($_POST["aid"]) && isset($steg)) {
$aktivitet_sel = $steg->getAktivitetId();
$aktivitet = $steg->getAktivitet();
} else {
if (isset($_POST["aid"])) {
$aktivitet_sel = $_POST["aid"];
$aktivitet = Aktivitet::loadById($_POST["aid"]);
} else {
$aktivitet_sel = "";
}
}
if (isset($aktivitet)) {
$smarty->assign("aktivitet", $aktivitet);
}
$smarty->assign("aktivitet_sel", $aktivitet_sel);
$aktivitet_names = Misc::arrayKeyMerge(array("" => "Välj..."), Aktivitet::listField("namn"));
$smarty->assign("aktivitet_names", $aktivitet_names);
$smarty->display('steg.tpl');
示例5: MMSmarty
<?php
include $_SERVER["DOCUMENT_ROOT"] . "/php/init.php";
$smarty = new MMSmarty();
$smarty->assign("pagetitle", "Beställning för företag");
$nummer = array();
for ($i = 1; $i <= 100; $i++) {
$nummer[$i] = $i;
}
$opt_kommuner = Misc::arrayKeyMerge(array("" => "Välj..."), Kommun::listField("namn"));
$campaignCodes = Order::getCampaignCodes("foretag");
$cc_array = array();
foreach ($campaignCodes as $id => $cc) {
if (isset($cc["popupid"])) {
$helper = Help::loadById($cc["popupid"]);
}
$cc["popupwidth"] = $helper->getSizeX();
$cc["popupheight"] = $helper->getSizeY();
$cc_array[$id] = $cc;
}
//find and list 10 mondays at least 14 days ahead
$datumalternativ = array();
$datumstralt = array();
$addDays = 14 + (8 - date("w"));
//the fist monday at least 14 days ahead
$firstMonday = date("Y-m-d", strtotime(date("Y-m-d") . "+{$addDays} days"));
$monday = $firstMonday;
for ($i = 0; $i < 15; ++$i) {
$datumalternativ[] = $monday;
$datumstralt[] = "Måndagen den " . date('j', strtotime($monday)) . " " . ucfirst(Misc::month(date('n', strtotime($monday))));
//nice format