protected function setLinkAttributes(Tag $tag, $linkInfo, $attrName)
	{
		$url   = trim($linkInfo);
		$title = '';
		$pos   = strpos($url, ' ');
		if ($pos !== false)
		{
			$title = substr(trim(substr($url, $pos)), 1, -1);
			$url   = substr($url, 0, $pos);
		}

		$tag->setAttribute($attrName, $this->text->decode($url));
		if ($title > '')
		{
			$tag->setAttribute('title', $this->text->decode($title));
		}
	}
protected function setLinkAttributes(Tag $tag, $linkInfo, $attrName)
	{
		$url   = trim($linkInfo);
		$title = '';
		$pos   = strpos($url, ' ');
		if ($pos !== false)
		{
			$title = substr(trim(substr($url, $pos)), 1, -1);
			$url   = substr($url, 0, $pos);
		}

		$tag->setAttribute($attrName, $this->text->decode($url));
		if ($title > '')
		{
			$tag->setAttribute('title', $this->text->decode($title));
		}
	}
protected function setLinkAttributes ( Tag $ tag , $ linkInfo , $ attrName ) { $ url = trim ( $ linkInfo ) ; $ title = '' ; $ pos = strpos ( $ url , ' ' ) ; if ( $ pos !== false ) { $ title = substr ( trim ( substr ( $ url , $ pos ) ) , 1 , - 1 ) ; $ url = substr ( $ url , 0 , $ pos ) ; } $ tag -> setAttribute ( $ attrName , $ this -> text -> decode ( $ url ) ) ; if ( $ title > '' ) { $ tag -> setAttribute ( 'title' , $ this -> text -> decode ( $ title ) ) ; } }
Set a URL or IMG tag's attributes

@param  Tag    $tag      URL or IMG tag
@param  string $linkInfo Link's info: an URL optionally followed by spaces and a title
@param  string $attrName Name of the URL attribute
@return void
Set a URL or IMG tag s attributes