我有一个旧文件。我想将它集成到我购买的新模板中。
我有一个链接列表。我将它们存储在 Session 数组中。每个数组都有一个标题和一个 url
<?php session_start();
//in my old file i write this
foreach ($_SESSION[links] as $value){
?>
<a href="<?php print $value[linkurl]?>"><?php print $value[linktitle]?></a ><?php
}
// array style i need to match in the new file
// "name" => array(
// "title" => "Display Title",
// "url" => "http://yoururl.com"
// )
// what i tried
// foreach ($_SESSION[links] as $value){
// "$value[linktitle]" => array(
// "title" => "$value[linktitle]",
// "url" => "$value[linkurl]"
// )
// }
//obviously doesn't work
?>
这是完整的模板。我正在尝试替换 Smart UI 子(轮播、标签...)
<?php
//CONFIGURATION for SmartAdmin UI
//ribbon breadcrumbs config
//array("Display Name" => "URL");
$breadcrumbs = array(
"Home" => APP_URL
);
/*navigation array config
ex:
"dashboard" => array(
"title" => "Display Title",
"url" => "http://yoururl.com",
"url_target" => "_self",
"icon" => "fa-home",
"label_htm" => "<span>Add your custom label/badge html here</span>",
"sub" => array() //contains array of sub items with the same format as the parent
)
*/
$page_nav = array(
"dashboard" => array(
"title" => "Dashboard",
"url" => APP_URL,
),
"smartui" => array(
"title" => "Smart UI",
"icon" => "fa-code",
"sub" => array(
"carousel" => array(
"title" => "Carousel",
"url" => APP_URL.'/smartui-carousel.php'
),
"tab" => array(
"title" => "Tab",
"url" => APP_URL.'/smartui-tab.php'
),
"accordion" => array(
"title" => "Accordion",
"url" => APP_URL.'/smartui-accordion.php'
),
"widget" => array(
'title' => "Widget",
'url' => APP_URL."/smartui-widget.php"
),
"datatable" => array(
"title" => "DataTable",
"url" => APP_URL."/smartui-datatable.php"
),
"button" => array(
"title" => "Button",
"url" => APP_URL."/smartui-button.php"
),
'smartform' => array(
'title' => 'Smart Form',
'url' => APP_URL.'/smartui-form.php'
)
)
)
);
//configuration variables
$page_title = "";
$page_css = array();
$no_main_header = false; //set true for lock.php and login.php
$page_body_prop = array(); //optional properties for <body>
$page_html_prop = array(); //optional properties for <html>
?>
var_dump:
array(6) {
[0]=> array(4) { ["linktitle"]=> string(13) "Claims Center" ["linkurl"]=> string(79) "Claims.php" ["Sectionlinktitle"]=> string(12) "Applications" ["linkdes"]=> string(11) "Application" }
[1]=> array(4) { ["linktitle"]=> string(16) "Expense Allocate" ["linkurl"]=> string(81) "Expense.php" ["Sectionlinktitle"]=> string(12) "Applications" ["linkdes"]=> string(11) "Application" }
[2]=> array(4) { ["linktitle"]=> string(13) "Freight Rater" ["linkurl"]=> string(105) "User.php" ["Sectionlinktitle"]=> string(12) "Applications" ["linkdes"]=> string(11) "Application" }
[3]=> array(4) { ["linktitle"]=> string(14) "Invoice Center" ["linkurl"]=> string(71) "Online.php" ["Sectionlinktitle"]=> string(12) "Applications" ["linkdes"]=> string(11) "Application" }
[4]=> array(4) { ["linktitle"]=> string(4) "KPIs" ["linkurl"]=> string(4) "KPIs" ["Sectionlinktitle"]=> string(10) "Dashboards" ["linkdes"]=> string(9) "Dashboard" }
[5]=> array(4) { ["linktitle"]=> string(16) "Multi-Mode Rater" ["linkurl"]=> string(0) "M" ["Sectionlinktitle"]=> string(12) "Applications" ["linkdes"]=> string(16) "Multi-Mode Rater" }
}