using System.Collections.Generic;
using System.Text;
using System.Web.Mvc;
using Kreta.Framework;
namespace Kreta.Web.Helpers
{
public static class LinkExtensions
{
public static MvcHtmlString KretaLink(this HtmlHelper helper, int title, string href = "#", string classes = "", string content = "")
{
StringBuilder sb = new StringBuilder();
sb.Append($"{content}");
MvcHtmlString str = new MvcHtmlString(sb.ToString());
return str;
}
public static MvcHtmlString KretaActionLink(this HtmlHelper helper, string title = "", string href = "#", string classes = "", string content = "", IDictionary htmlAttributes = null)
{
StringBuilder sb = new StringBuilder();
StringBuilder htmlAttributesString = new StringBuilder();
if (htmlAttributes != null)
{
foreach (KeyValuePair item in htmlAttributes)
{
htmlAttributesString.Append($"{item.Key}=\"{item.Value}\" ");
}
}
sb.Append($"{content}");
MvcHtmlString str = new MvcHtmlString(sb.ToString());
return str;
}
}
}