public function deleteLink($target, $caption = null, $confirmMessage = 'Are you sure?', $attributes = array())
		{

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

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

			}

			// Set method to delete
			$attributes = array_merge(array(
				"data-method" => "delete",
				"rel" => "nofollow"
			), $attributes);

			// Confirm?
			if (is_null($confirmMessage)) {
				$attributes['data-confirm'] = 'Are you sure?';
			} elseif ($confirmMessage !== false) {
				$attributes['data-confirm'] = $confirmMessage;
			}

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

		}
public function deleteLink($target, $caption = null, $confirmMessage = 'Are you sure?', $attributes = array())
		{

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

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

			}

			// Set method to delete
			$attributes = array_merge(array(
				"data-method" => "delete",
				"rel" => "nofollow"
			), $attributes);

			// Confirm?
			if (is_null($confirmMessage)) {
				$attributes['data-confirm'] = 'Are you sure?';
			} elseif ($confirmMessage !== false) {
				$attributes['data-confirm'] = $confirmMessage;
			}

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

		}
public function deleteLink ( $ target , $ caption = null , $ confirmMessage = 'Are you sure?' , $ attributes = array ( ) ) { // Check if target needs to be resolved if ( is_array ( $ target ) || is_object ( $ target ) ) { // Try to get a link $ target = Url :: instance ( ) -> delete ( $ target ) ; } // Set method to delete $ attributes = array_merge ( array ( "data-method" => "delete" , "rel" => "nofollow" ) , $ attributes ) ; // Confirm? if ( is_null ( $ confirmMessage ) ) { $ attributes [ 'data-confirm' ] = 'Are you sure?' ; } elseif ( $ confirmMessage !== false ) { $ attributes [ 'data-confirm' ] = $ confirmMessage ; } // Create element $ link = new \ HtmlObject \ Link ( $ target , $ caption , $ attributes ) ; return $ link ; }
Create new delete Link element

**Note** This requires the ChickenWire front-end Javascript library to be included in your page.

@param  \ChickenWire\Model|string 	The Model instance to create the delete link for, or a string containing a url.
@param  string 						The text/elements to put inside the link.
@param  string|false 				The message to confirm the deletion. When false, no message will be shown.
@param  array  						An array of attributes to add to the element.
@return \HtmlObject\Link 		The Link element.
Create new delete Link element