* 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
This is done in toHtml() method. Object are stored as references." name="HTML_Link" static="0" scope="200" >
<UML:Operation stereotype="" package="" xmi.id="221" type="void" abstract="0" documentation="Constructor." name="HTML_Link" static="0" scope="200" >
<UML:Parameter stereotype="" package="" xmi.id="1" value="''" type="string" abstract="0" documentation="Hypertext reference." name="href" static="0" scope="200" />
- <UML:Parameter stereotype="" package="" xmi.id="5" value="''" type="&mixed" abstract="0" documentation="Link contents." name="contents" static="0" scope="200" />
+ <UML:Parameter stereotype="" package="" xmi.id="5" value="''" type="mixed" abstract="0" documentation="Link contents." name="contents" static="0" scope="200" />
<UML:Parameter stereotype="" package="" xmi.id="6" value="array()" type="array" abstract="0" documentation="Array (as key => value pairs) of GET variables to pass to the link." name="getVars" static="0" scope="200" />
<UML:Parameter stereotype="" package="" xmi.id="7" value="array()" type="array" abstract="0" documentation="Other links (A tag) attributes." name="attrs" static="0" scope="200" />
</UML:Operation>