Cake.Web.Helpers.LinkHelper.GetLink C# (CSharp) Метод

GetLink() публичный статический Метод

public static GetLink ( Cake.Web.Core.Content.Blog.BlogCategory category ) : string
category Cake.Web.Core.Content.Blog.BlogCategory
Результат string
        public static string GetLink(BlogCategory category)
        {
            return string.Concat("/blog/category/", category.Slug);
        }

Same methods

LinkHelper::GetLink ( Cake.Web.Core.Content.Blog.BlogPost post ) : string
LinkHelper::GetLink ( Topic topic ) : string
LinkHelper::GetLink ( Cake.Web.Core.Content.Documentation.TopicSection section ) : string

Usage Example

Пример #1
0
 public static void WriteLink(HtmlTextWriter writer, Topic topic)
 {
     if (string.IsNullOrWhiteSpace(topic.Body))
     {
         writer.Write(topic.Name);
     }
     else
     {
         var path = LinkHelper.GetLink(topic);
         writer.AddAttribute(HtmlTextWriterAttribute.Href, path);
         writer.RenderBeginTag(HtmlTextWriterTag.A);
         writer.Write(topic.Name);
         writer.RenderEndTag();
     }
 }
All Usage Examples Of Cake.Web.Helpers.LinkHelper::GetLink