For binary items URL path and path point to SNAPSHOT_PATH_RELATIVE.
Item's attributes with special meaning:
- title: title of the item.
- title_path: title extracted from the date filename pattern.
- preserve_path_title: if true "title_path" instead of "title" will be used with ":title" placeholder.
- date: date of item.
- categories: categories for the item
- permalink: permalink sytle.
- collection: the name of the item's collection.
public getPermalink ( Yosymfony\Spress\Core\DataSource\ItemInterface $item ) : Yosymfony\Spress\Core\ContentManager\Permalink\PermalinkInterface | ||
$item | Yosymfony\Spress\Core\DataSource\ItemInterface | |
return | Yosymfony\Spress\Core\ContentManager\Permalink\PermalinkInterface |
/** * @expectedException \Yosymfony\Spress\Core\ContentManager\Exception\AttributeValueException */ public function testPrettyBadDateAttribute() { $pmg = new PermalinkGenerator('pretty'); $permalink = $pmg->getPermalink($this->createItem('index.html', ['date' => []])); }
/** * @expectedException Yosymfony\Spress\Core\ContentManager\Exception\AttributeValueException * @expectedExceptionMessage Invalid value. Expected string in "index.html" at key "permalink". */ public function testBadTypeHintPermalinkAttribute() { $pmg = new PermalinkGenerator('pretty'); $pmg->getPermalink($this->createItem('index.html', ['permalink' => []])); }