<?php

use Drupal\restaurant\Helper\Helper;

class LinkHelper extends Helper
{
  public function link($args)
  {
    if (empty ($args[0])) {
      throw new Exception("href argument requried for link helper");
    }
    if (empty ($args[1])) {
      throw new Exception("link text required for link helper");
    }

    $str = '<a class="ajax-link use-ajax" href="' . $args[0] . '">' . $args[1] . '</a>';
    return $str;
  }
}
