class Template {
public $temp;
public $stemp;
public $track;
public $optype;
public $arr_elem;
public $temp_elem;
public $path = "templates/";
public $temp_name = "default";
public $ext = ".tpl";
public $arr_type = array("options","inputs");
public function render_page($tpl, $arr_data="", $directory="")
{
$directory = ($directory)? $directory."/" : $directory;
$this->track = $this->path.$this->temp_name."/".$directory.$tpl.$this->ext;
return $this->temp;
if($this->temp)
{
foreach($arr_data as $elem => $val)
{
{
$this->arr_elem = explode("-",$elem); $elem = $this->arr_elem[0];
$this->temp_elem = substr($this->arr_elem[1
], 0
, -1
); foreach($val as $attr => $op)
{
if(in_array($this->arr_elem[1
] ,$this->arr_type)) {
switch($this->arr_elem[1])
{
case "options":
$this->optype .= "<$this->temp_elem value=\"$attr\">$op</$this->temp_elem>";
break;
case "inputs":
$this->optype .= "$op<$this->temp_elem name=\"$attr\" />";
break;
}
}
else
$this->optype .= $op;
}
$this->stemp = $this->optype;
}
else
$this->stemp = $val;
$this->temp = str_replace("{tpl::$elem}", $this->stemp, $this->temp); }
return $this->temp;
}
else
return $this->track." not found<br />";
}
public function __desctruct()
{
}
Wywala mi 1 błąd w 42 linijce i 6 błędów w 45.
Nie mam pojęcia co jest nie tak.
Ten post edytował nygus9928 24.10.2014, 17:58:17