C# Class DotLiquid.StandardFilters

Afficher le fichier Open project: dotliquid/dotliquid Class Usage Examples

Méthodes publiques

Méthode Description
Append ( string input, string @string ) : string

Add one string to another

Capitalize ( string input ) : string

capitalize words in the input sentence

Date ( object input, string format ) : string

Formats a date using a .NET date format string

Default ( string input, string @defaultValue ) : string

If a value isn't set for a variable in the template, allow the user to specify a default value for that variable

DividedBy ( object input, object operand ) : object

Division

Downcase ( string input ) : string

convert a input string to DOWNCASE

Escape ( string input ) : string
First ( IEnumerable array ) : object

Get the first element of the passed in array Example: {{ product.images | first | to_img }}

H ( string input ) : string
Join ( IEnumerable input ) : string

Join elements of the array with a certain character between them

Join ( IEnumerable input, string glue ) : string

Join elements of the array with a certain character between them

Last ( IEnumerable array ) : object

Get the last element of the passed in array Example: {{ product.images | last | to_img }}

Map ( IEnumerable input, string property ) : IEnumerable

Map/collect on a given property

Minus ( object input, object operand ) : object

Subtraction

Modulo ( object input, object operand ) : object
NewlineToBr ( string input ) : string

Add
tags in front of all newlines in input string

Plus ( object input, object operand ) : object

Addition

Prepend ( string input, string @string ) : string

Prepend a string to another

Remove ( string input, string @string ) : string

Remove a substring

RemoveFirst ( string input, string @string ) : string

Remove the first occurrence of a substring

Replace ( string input, string @string ) : string

Replace occurrences of a string with another

Replace ( string input, string @string, string replacement ) : string

Replace occurrences of a string with another

ReplaceFirst ( string input, string @string ) : string

Replace the first occurence of a string with another

ReplaceFirst ( string input, string @string, string replacement ) : string

Replace the first occurence of a string with another

Round ( object input, object places = null ) : object
Size ( object input ) : int

Return the size of an array or of an string

Slice ( string input, int start, int len = 1 ) : string

Return a Part of a String

Sort ( object input ) : IEnumerable

Sort elements of the array provide optional property with which to sort an array of hashes or drops

Sort ( object input, string property ) : IEnumerable

Sort elements of the array provide optional property with which to sort an array of hashes or drops

Split ( string input, string pattern ) : string[]

Split input string into an array of substrings separated by given pattern.

StripHtml ( string input ) : string
StripNewlines ( string input ) : string

Remove all newlines from the string

Times ( object input, object operand ) : object

Multiplication

Truncate ( string input ) : string

Truncates a string down to 15 characters

Truncate ( string input, int length ) : string

Truncates a string down to length characters

Truncate ( string input, int length, string truncateString ) : string

Truncates a string down to x characters

TruncateWords ( string input ) : string
TruncateWords ( string input, int words ) : string
TruncateWords ( string input, int words, string truncateString ) : string
Upcase ( string input ) : string

convert a input string to UPCASE

UrlEncode ( string input ) : string

convert a input string to URLENCODE

Private Methods

Méthode Description
DoMathsOperation ( object input, object operand, Func operation ) : object
IsReal ( object o ) : bool

Method Details

Append() public static méthode

Add one string to another
public static Append ( string input, string @string ) : string
input string
@string string
Résultat string

Capitalize() public static méthode

capitalize words in the input sentence
public static Capitalize ( string input ) : string
input string
Résultat string

Date() public static méthode

Formats a date using a .NET date format string
public static Date ( object input, string format ) : string
input object
format string
Résultat string

Default() public static méthode

If a value isn't set for a variable in the template, allow the user to specify a default value for that variable
public static Default ( string input, string @defaultValue ) : string
input string
@defaultValue string
Résultat string

DividedBy() public static méthode

Division
public static DividedBy ( object input, object operand ) : object
input object
operand object
Résultat object

Downcase() public static méthode

convert a input string to DOWNCASE
public static Downcase ( string input ) : string
input string
Résultat string

Escape() public static méthode

public static Escape ( string input ) : string
input string
Résultat string

First() public static méthode

Get the first element of the passed in array Example: {{ product.images | first | to_img }}
public static First ( IEnumerable array ) : object
array IEnumerable
Résultat object

H() public static méthode

public static H ( string input ) : string
input string
Résultat string

Join() public static méthode

Join elements of the array with a certain character between them
public static Join ( IEnumerable input ) : string
input IEnumerable
Résultat string

Join() public static méthode

Join elements of the array with a certain character between them
public static Join ( IEnumerable input, string glue ) : string
input IEnumerable
glue string
Résultat string

Last() public static méthode

Get the last element of the passed in array Example: {{ product.images | last | to_img }}
public static Last ( IEnumerable array ) : object
array IEnumerable
Résultat object

Map() public static méthode

Map/collect on a given property
public static Map ( IEnumerable input, string property ) : IEnumerable
input IEnumerable
property string
Résultat IEnumerable

Minus() public static méthode

Subtraction
public static Minus ( object input, object operand ) : object
input object
operand object
Résultat object

Modulo() public static méthode

public static Modulo ( object input, object operand ) : object
input object
operand object
Résultat object

NewlineToBr() public static méthode

Add
tags in front of all newlines in input string
public static NewlineToBr ( string input ) : string
input string
Résultat string

Plus() public static méthode

Addition
public static Plus ( object input, object operand ) : object
input object
operand object
Résultat object

Prepend() public static méthode

Prepend a string to another
public static Prepend ( string input, string @string ) : string
input string
@string string
Résultat string

Remove() public static méthode

Remove a substring
public static Remove ( string input, string @string ) : string
input string
@string string
Résultat string

RemoveFirst() public static méthode

Remove the first occurrence of a substring
public static RemoveFirst ( string input, string @string ) : string
input string
@string string
Résultat string

Replace() public static méthode

Replace occurrences of a string with another
public static Replace ( string input, string @string ) : string
input string
@string string
Résultat string

Replace() public static méthode

Replace occurrences of a string with another
public static Replace ( string input, string @string, string replacement ) : string
input string
@string string
replacement string
Résultat string

ReplaceFirst() public static méthode

Replace the first occurence of a string with another
public static ReplaceFirst ( string input, string @string ) : string
input string
@string string
Résultat string

ReplaceFirst() public static méthode

Replace the first occurence of a string with another
public static ReplaceFirst ( string input, string @string, string replacement ) : string
input string
@string string
replacement string
Résultat string

Round() public static méthode

public static Round ( object input, object places = null ) : object
input object
places object
Résultat object

Size() public static méthode

Return the size of an array or of an string
public static Size ( object input ) : int
input object
Résultat int

Slice() public static méthode

Return a Part of a String
public static Slice ( string input, int start, int len = 1 ) : string
input string
start int
len int
Résultat string

Sort() public static méthode

Sort elements of the array provide optional property with which to sort an array of hashes or drops
public static Sort ( object input ) : IEnumerable
input object
Résultat IEnumerable

Sort() public static méthode

Sort elements of the array provide optional property with which to sort an array of hashes or drops
public static Sort ( object input, string property ) : IEnumerable
input object
property string
Résultat IEnumerable

Split() public static méthode

Split input string into an array of substrings separated by given pattern.
public static Split ( string input, string pattern ) : string[]
input string
pattern string
Résultat string[]

StripHtml() public static méthode

public static StripHtml ( string input ) : string
input string
Résultat string

StripNewlines() public static méthode

Remove all newlines from the string
public static StripNewlines ( string input ) : string
input string
Résultat string

Times() public static méthode

Multiplication
public static Times ( object input, object operand ) : object
input object
operand object
Résultat object

Truncate() public static méthode

Truncates a string down to 15 characters
public static Truncate ( string input ) : string
input string
Résultat string

Truncate() public static méthode

Truncates a string down to length characters
public static Truncate ( string input, int length ) : string
input string
length int
Résultat string

Truncate() public static méthode

Truncates a string down to x characters
public static Truncate ( string input, int length, string truncateString ) : string
input string
length int
truncateString string
Résultat string

TruncateWords() public static méthode

public static TruncateWords ( string input ) : string
input string
Résultat string

TruncateWords() public static méthode

public static TruncateWords ( string input, int words ) : string
input string
words int
Résultat string

TruncateWords() public static méthode

public static TruncateWords ( string input, int words, string truncateString ) : string
input string
words int
truncateString string
Résultat string

Upcase() public static méthode

convert a input string to UPCASE
public static Upcase ( string input ) : string
input string
Résultat string

UrlEncode() public static méthode

convert a input string to URLENCODE
public static UrlEncode ( string input ) : string
input string
Résultat string