Skip to content

Latest commit

 

History

History
163 lines (152 loc) · 3.8 KB

File metadata and controls

163 lines (152 loc) · 3.8 KB

Custom Url Helpers

These helpers provide some ability to manage strings for use within a url.


Helpers.Url.Base64Decode

Summary Base64 decode string
Returns Decoded string
Remarks
Parameters
str Base64 encoded string to decode

Example

Context

{
    "value": "TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gVml2YW11cyBsYWNpbmlhIHVybmEgbGVjdHVzLg=="
}

Usage

<strong>result:</strong>
{{Helpers.Url.Base64Decode value}}
{{Helpers.Url.Base64Decode "c29tZXRoaW5nIHdpY2tlZCB0aGlzIHdheSBjb21lcw=="}}

Returns

<strong>result:</strong>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus lacinia urna lectus.
something wicked this way comes

Helpers.Url.Base64Encode

Summary Base64 encode string
Returns Base64 encoded string
Remarks
Parameters
str String to Baes64 encode

Example

Context

{
    "value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus lacinia urna lectus."
}

Usage

<strong>result:</strong>
{{Helpers.Url.Base64Encode value}}
{{Helpers.Url.Base64Encode "something wicked this way comes"}}

Returns

<strong>result:</strong>
TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gVml2YW11cyBsYWNpbmlhIHVybmEgbGVjdHVzLg==
c29tZXRoaW5nIHdpY2tlZCB0aGlzIHdheSBjb21lcw==

Helpers.Url.DecodeUri

Summary Decode a uri encoded string
Returns decoded string
Remarks
Parameters
str Uri encoded string

Example

Context

{
    "value": "arinet%2FHandlebarDocs%2Fblob%2Fmaster%2FcustomHelpers%2Furl.md%23helpersurldecodeuri"
}

Usage

<strong>result:</strong>
{{Helpers.Url.DecodeUri value}}
{{Helpers.Url.DecodeUri "%2Fsearch%2Finventory%2Fbrand%2FPolaris+Industries%2Fsort%2Fbest-match"}}

Returns

<strong>result:</strong>
arinet/HandlebarDocs/blob/master/customHelpers/url.md#helpersurldecodeuri
/search/inventory/brand/Polaris Industries/sort/best-match

Helpers.Url.EncodeUri

Summary Uri encode a string
Returns Uri encoded string
Remarks
Parameters
str String to encode

Example

Context

{
    "value": "arinet/HandlebarDocs/blob/master/customHelpers/url.md#helpersurlencodeuri"
}

Usage

<strong>result:</strong>
{{Helpers.Url.EncodeUri value}}
{{Helpers.Url.EncodeUri "/search/inventory/brand/Polaris Industries/sort/best-match"}}

Returns

<strong>result:</strong>
arinet%2FHandlebarDocs%2Fblob%2Fmaster%2FcustomHelpers%2Furl.md%23helpersurlencodeuri
%2Fsearch%2Finventory%2Fbrand%2FPolaris+Industries%2Fsort%2Fbest-match

Helpers.Url.StripProtocol

Summary Remove protocol from url
Returns Protocol free url
Remarks
Parameters
str Url to remove protocol from

Example

Context

{
    "value": "https://github.com/arinet/HandlebarDocs/blob/master/customHelpers/url.md#helpersurlstripprotocol"
}

Usage

<strong>result:</strong>
{{Helpers.Url.StripProtocol value}}
{{Helpers.Url.StripProtocol "https://www.duluthlawnandsport.com/s/search/inventory/brand/Polaris%20Industries/sort/best-match"}}

Returns

<strong>result:</strong>
//github.com/arinet/HandlebarDocs/blob/master/customHelpers/url.md#helpersurlstripprotocol
//www.duluthlawnandsport.com/s/search/inventory/brand/Polaris%20Industries/sort/best-match