str::link($href, $text = null, $attr = array())

Generates an a tag

  • $href (string)
    The url for the a tag
  • $text (mixed)
    The optional text. If null, the url will be used as text
  • $attr (array)
    Additional attributes for the tag
  • return (string)
    the generated html


echo str::link('');
echo str::link('', 'Visit our website');
echo str::link('', 'Visit our website', array(
  'class' => 'ajax-link',


<a href=""></a>
<a href="">Visit our website</a>
<a href="" class="ajax-link">Visit our website</a>

Is something missing or incorrect? Edit this page on Github…