public function link($target, $caption = null, $attributes = array())
		{

			// Check if target needs to be resolved
			if (is_object($target)) {

				// Try to get a link
				$target = Url::instance()->show($target);

			}

			// Create element
			$link = new \HtmlObject\Link($target, $caption, $attributes);
			return $link;

		}
public function link($target, $caption = null, $attributes = array())
		{

			// Check if target needs to be resolved
			if (is_object($target)) {

				// Try to get a link
				$target = Url::instance()->show($target);

			}

			// Create element
			$link = new \HtmlObject\Link($target, $caption, $attributes);
			return $link;

		}
public function link ( $ target , $ caption = null , $ attributes = array ( ) ) { // Check if target needs to be resolved if ( is_object ( $ target ) ) { // Try to get a link $ target = Url :: instance ( ) -> show ( $ target ) ; } // Create element $ link = new \ HtmlObject \ Link ( $ target , $ caption , $ attributes ) ; return $ link ; }
Create a new Link element

<code>
echo $this->html->link('http://www.google.com/', 'Google', array("target" => "_blank"));
</code>
<code>
<a href="http://www.google.com/" target="_blank">Google</a>
</code>
<br>

<code>
$person = People::find(1);
echo $this->html->link($person, $person->name);
</code>
<code>
<a href="/people/1">John Doe</a>
</code>
<br>

<code>
$person = People::find(1);
echo $this->html->link($this->url->edit($person), "Edit " . $person->name);
</code>
<code>
<a href="/people/1/edit">John Doe</a>
</code>

@param  string|\ChickenWire\Model 	A url or a Model instance to link to. When you pass a Model instance, the Url helper will be used to resolve it to a 'show' action url.
@param  string 						The text/elements to put inside the link.
@param  array  						An array of attributes to add to the element.
@return \HtmlObject\Link            The Link element.
Create a new Link element