Hi,
I'm very new to PHP. I'm trying to create a class that will kick back the required html to make a menu. For some reason I keep getting this error:
PHP Parse error: syntax error, unexpected '{' on line 2
This seems like it should be an easy fix but I've looked everywhere trying to find the answer with no luck. Please help.
Here is the code:
<?php
class*myMenu {
public $html;
public $cssFile;
private $labels;
private $links;
public function myMenu($xlabels, $xlinks){
$this->labels = $xlabels;
$this->links = $xlinks;
$this->cssFile = '#demo-container{padding:25px 15px 0 15px;background:#67A897;}
ul#simple-menu{list-style-type:none;width:100%;position:relative;height:27px;font-family:"Trebuchet MS",Arial,sans-serif;font-size:13px;font-weight:bold;margin:0;padding:11px 0 0 0;}
ul#simple-menu li{display:block;float:left;margin:0 0 0 4px;height:27px;}
ul#simple-menu li.left{margin:0;}
ul#simple-menu li a{display:block;float:left;color:#fff;background:#4A6867;line-height:27px;text-decoration:none;padding:0 17px 0 18px;height:27px;}
ul#simple-menu li a.right{padding-right:19px;}
ul#simple-menu li a:hover{background:#2E4560;}
ul#simple-menu li a.current{color:#2E4560;background:#fff;}
ul#simple-menu li a.current:hover{color:#2E4560;background:#fff;}
}'
$html = '<div id="demo-container"><ul id="simple-menu">';
foreach($labels as $i && $links as $l){
$this->html = $this->html + '<li><a href="' + $l + '" title="' + $i + '">Resources</a></li>';
}
$this->html = $this->html + '</ul>';
}
public function getContent(){
$content = array("html" => $html, "cssFile" => $cssFile);
return $content;
}
}
?>