PHP Class Yosymfony\Spress\Core\ContentManager\Permalink\PermalinkGenerator

Attributes with special meaning: - permalink: (string) The permalink template. - preserve_path_title: (bool) - date: (string) - categories: (array) Placeholders: - ":path" : /my-page - ":basename" : about-me - ":extension" : html
Author: Victor Puertas ([email protected])
Inheritance: implements Yosymfony\Spress\Core\ContentManager\Permalink\PermalinkGeneratorInterface
Afficher le fichier Open project: spress/spress Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( string $defaultPermalink = 'pretty', boolean $defaultPreservePathTitle = false, boolean $defaultNoHtmlExtension = false ) Constructor.
getPermalink ( Yosymfony\Spress\Core\DataSource\ItemInterface $item ) : Yosymfony\Spress\Core\ContentManager\Permalink\PermalinkInterface Gets a permalink. This method uses the SNAPSHOT_PATH_RELATIVE_AFTER_CONVERT of Item path.

Private Methods

Méthode Description
generatePath ( $template, array $placeholders = [] )
generateUrlPath ( $template, array $placeholders = [] )
getCategoriesPath ( Yosymfony\Spress\Core\DataSource\ItemInterface $item )
getDateAttribute ( Yosymfony\Spress\Core\DataSource\ItemInterface $item )
getNoHtmlExtensionAttribute ( Yosymfony\Spress\Core\DataSource\ItemInterface $item )
getPermalinkAttribute ( Yosymfony\Spress\Core\DataSource\ItemInterface $item )
getPlacehoders ( Yosymfony\Spress\Core\DataSource\ItemInterface $item )
getPreservePathTitleAttribute ( Yosymfony\Spress\Core\DataSource\ItemInterface $item )
getTitleSlugified ( Yosymfony\Spress\Core\DataSource\ItemInterface $item )
isCustomCollection ( Yosymfony\Spress\Core\DataSource\ItemInterface $item )
isItemWithDate ( Yosymfony\Spress\Core\DataSource\ItemInterface $item )
sanitize ( $url )
templateNeedsDate ( $template )

Method Details

__construct() public méthode

Constructor.
public __construct ( string $defaultPermalink = 'pretty', boolean $defaultPreservePathTitle = false, boolean $defaultNoHtmlExtension = false )
$defaultPermalink string Each item's URL are prefixed by "/:collection" if the item are included in a custom collection. "pretty" permalink style: - item: "/:path/:basename" - item with date: "/:categories/:year/:month/:day/:title/" "date" permalink style: - item: "/:path/:basename.:extension" - item with date: "/:categories/:year/:month/:day/:title.:extension" "ordinal" permalink style: - item: "/:path/:basename.:extension" - item with date: "/:categories/:year/:i_day/:title.:extension" "none" permalink style: - item: "/:path/:basename.:extension"
$defaultPreservePathTitle boolean Default value for Preserve-path-title
$defaultNoHtmlExtension boolean Default value for no-html-extension