* Constructor.
*
* @param string $href Hypertext reference.
- * @param mixed &$contents Link contents.
+ * @param mixed $contents Link contents.
* @param array $getVars Array (as key => value pairs) of GET variables to pass to the link.
* @param array $attrs Other links (A tag) attributes.
*
* @return void
* @access public
*/
- function HTML_Link($href = '', &$contents = '', $getVars = array(), $attrs = array()) // ~X2C
+ function HTML_Link($href = '', $contents = '', $getVars = array(), $attrs = array()) // ~X2C
{
if (is_array($attrs)) {
$attrs['href'] = $href;
foreach ($this->getAttributes() as $key => $val) {
if ($key == 'href') {
$vars = array();
- foreach ($this->_getVars() as $var => $v) {
+ foreach ($this->_getVars as $var => $v) {
if (is_object($v) and method_exists($v, 'tostring')) {
$v = $v->tostring();
} elseif (is_object($v) or is_array($v)) {
}
$vars[] = urlencode($var) . '=' . urlencode($v);
}
- $val = '?' . join('&', $vars);
+ if ($vars) {
+ $val = '?' . join('&', $vars);
+ }
}
$attrs .= ' ' . $key . '="' . htmlentities($val) . '"';
}
- return "<A$attrs>" . htmlentities($this->getContents) . '</A>';
+ return "<A$attrs>" . htmlentities($this->getContents()) . '</A>';
}
// -X2C
{
$keys = func_get_args();
foreach ($keys as $key) {
- unset($this->_getVars($key));
+ unset($this->_getVars[$key]);
}
}
// -X2C