HEX
Server: Apache
System: Linux v38079.2is.nl 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: democfellows (10015)
PHP: 8.1.34
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/creativefellows.nl/fvr.creativefellows.nl/src/Domain/Field/ExternalLinkType.php
<?php

namespace App\Domain\Field;


/**
 * Lease Term data
 */
final class LinkType
{
	private $value = [];		
	function __construct($value =null)
	{	
		$this->value = $value;
		//d($this->value[0]);
	}
			
	public function value($html_tag = null,$element_class=null)
	{	
		//if(!$this->value || empty($this->value)) return;
		
	//	d($this->value);
		
		return '<a href="'. $this->value[0]->link() .'" class="'. $element_class .'">'. $this->value[0]->label() .'</a>';
		/*
		switch($html_tag)
		{
			//default: 
			//	return $html_tag == null || !$this->value ? $this->value : "<$html_tag". $this->class($element_class) .">".  $this->value ."</$html_tag>";  
			//break;
			default: 	
				return '<a href="'. $this->value[0]->link() .'" class="'. $element_class .'">'. $this->value[0]->label() .'</a>';
			break;
			
			case "a":
				return '<a href="'. $this->value[0]->link() .'" class="'. $element_class .'">'. $this->value[0]->label() .'</a>';
			break;
			
			
		}*/
		
	}
	
	private function class($element_class)
	{
		return $element_class != null ? ' class="'. $element_class .'"' : '';
	}
		
}