PHP Classes

Here is the class with some errors corrected.

Recommend this page to a friend!

      Html_dner  >  All threads  >  Here is the class with some errors...  >  (Un) Subscribe thread alerts  
Subject:Here is the class with some errors...
Summary:Package rating comment
Messages:1
Author:Ionut G
Date:2012-01-15 13:18:09
 

Ionut G rated this package as follows:

Utility: Sufficient
Consistency: Sufficient

  1. Here is the class with some errors...   Reply   Report abuse  
Picture of Ionut G Ionut G - 2012-01-15 13:18:09
Here is the class with some errors corrected.

class html_dner {
function __construct($element, $attrs = array(), $testo = ""){
$this->attributi = "";
foreach($attrs as $key => $value)
$this->attributi .= " ${key}=\"${value}\"";
$this->tag = $element;
$this->testo = $testo;
}
function addAttr($key, $value) {
$this->attributi .= " ${key}=\"${value}\"";
}
function setText($testo) {
$this->testo = $testo;
}
public function output(){
return "<$this->tag$this->attributi>$this->testo</$this->tag>";
}

}