How to echo property value of $item->link

I feel like I am missing something very simple but I cannot get this to work in my code. All I want to do is set $item-link to a new variable, and then echo the value, but I cannot get it to work. This is what I have …

<?php
foreach ($items as $item):    
    $heading = $item->value($headingTerm, ['default' => $this->translate('[Untitled]')]);
    $body = $item->value($bodyTerm);
    $LinkURL = $item->link;
?> 


<li class="item resource" </li>
		<a class="link-url" href="<?php echo  $LinkURL;   ?>"></a>
	        <?php echo $this->thumbnail($item, 'medium'); ?>
		<h4><?php echo $item->linkRaw($heading); ?> and <?php echo $LinkURL; ?> </h4>

</li>

What exactly are you trying to produce here? You’re using both link and linkRaw, which should produce links to the same URL, so it doesn’t really make sense that you’d use both.

Your attempt at assigning isn’t working because you aren’t actually calling link. By leaving off the open/close parentheses after link, you’re assigning the method, not the actual link text.

I know. I am trying to learn how to retrieve the actual link text instead of wrapping it around text to create a link. That’s what I am asking. The code above is just experimenting.

I am trying to get the link text so that I can create an span in order to style it via CSS so a user can click around the whole div, not just the title or the image.

By link text do you mean the URL? The equivalent to link() that just returns the URL is url().

Ah ha, I know it was something simple like that! Thank you - I was trying everything else but the obvious. Would you recommend a useful resource to look up functions such as this that pertains to Omeka?