Interface IUrlSegmentGenerator
Component that generates url segments for strings
Namespace: EPiServer.Web
Assembly: EPiServer.dll
Version: 11.20.7Syntax
public interface IUrlSegmentGenerator
Methods
Create(String, UrlSegmentOptions)
Creates a url friendly segment from the passed in string
Declaration
string Create(string proposedSegment, UrlSegmentOptions options)
Parameters
Type | Name | Description |
---|---|---|
System.String | proposedSegment | The segment to generate a url friendly segment for |
UrlSegmentOptions | options | The options used to generate the url segment |
Returns
Type | Description |
---|---|
System.String | A url friendly segment |
Remarks
ValidCharacters specifies which characthers that are considered valid.
CharacterMap specifies which character replacements.
If options
is null is options retrieved from IOC container.
IsValid(String, UrlSegmentOptions)
Determines if an url segment is considered url friendly
Declaration
bool IsValid(string segment, UrlSegmentOptions options)
Parameters
Type | Name | Description |
---|---|---|
System.String | segment | The segment to validate |
UrlSegmentOptions | options | The options used to validate the url segment |
Returns
Type | Description |
---|---|
System.Boolean | true if segment is considered valid else false |
Remarks
ValidCharacters specifies which characthers that are considered valid.
If options
is null is options retrieved from IOC container.