class ContentExtension extends AbstractExtension (View source)

Traits

Properties

protected LoggerInterface $logger from  LoggerTrait

Methods

void
setLogger(LoggerInterface $dbLogger)

No description

__construct(UrlGeneratorInterface $urlGenerator, ContentRepository $contentRepository, CsrfTokenManagerInterface $csrfTokenManager, Security $security, RequestStack $requestStack, Config $config, Query $query, TaxonomyRepository $taxonomyRepository, TranslatorInterface $translator, Canonical $canonical, ContentHelper $contentHelper, Notifications $notifications, Sanitiser $sanitiser)

No description

array
getFilters()

{@inheritdoc}

array
getFunctions()

{@inheritdoc}

string
getAnyTitle(Content $content, int $length = 120)

No description

string
getTitle(Content $content, string $locale = '', int $length = 120)

No description

array
getTitleFieldsNames(Content $content)

No description

ImageField|array|null
getImage(Content|null $content, bool $onlyValues = false)

No description

string
getExcerpt($content, int $length = 280, bool $includeTitle = false, $focus = null)

No description

Content|null
getPreviousContent(Content $content, string $byColumn = 'id', bool $sameContentType = true)

No description

Content|null
getNextContent(Content $content, string $byColumn = 'id', bool $sameContentType = true)

No description

bool
isCurrent(Environment $env, Content $content)

No description

void
allowTwig(Environment $env, Content $content)

No description

string|null
getLink($contentOrTaxonomy, bool $canonical = false, string|null $locale = null)

No description

string|null
getEditLink(Content $content)

No description

string|null
getDeleteLink(Content $content, bool $absolute = false)

No description

string|null
getDuplicateLink(Content $content, bool $absolute = false)

No description

string|null
getStatusLink(Content $content, bool $absolute = false)

No description

Collection
getTaxonomies(Content $content)

No description

Collection
getListTemplates(TemplateselectField $field)

No description

pager(Environment $twig, Pagerfanta $records = null, string $template = '@bolt/helpers/_pager_basic.html.twig', string $class = 'pagination', int $surround = 3)

No description

Collection
selectOptions(SelectField $field)

No description

Collection
taxonomyOptions(Collection $taxonomy)

No description

Collection
taxonomyValues(Collection $current, Collection $taxonomy)

No description

string
icon(Content|null $record = null, string $icon = 'question-circle')

No description

bool
hasPath(Content $record, string $path)

No description

statusOptions(Content $record)

No description

string
getSpecialFeature(Content $record)

No description

bool
isHomepage(Content $content)

No description

bool
is404(Content $content)

No description

bool
is403(Content $content)

No description

bool
isMaintenance(Content $content)

No description

bool
isHomepageListing(ContentType $contentType)

No description

sanitise(string $html)

No description

Details

void setLogger(LoggerInterface $dbLogger)

Parameters

LoggerInterface $dbLogger

Return Value

void

__construct(UrlGeneratorInterface $urlGenerator, ContentRepository $contentRepository, CsrfTokenManagerInterface $csrfTokenManager, Security $security, RequestStack $requestStack, Config $config, Query $query, TaxonomyRepository $taxonomyRepository, TranslatorInterface $translator, Canonical $canonical, ContentHelper $contentHelper, Notifications $notifications, Sanitiser $sanitiser)

Parameters

UrlGeneratorInterface $urlGenerator
ContentRepository $contentRepository
CsrfTokenManagerInterface $csrfTokenManager
Security $security
RequestStack $requestStack
Config $config
Query $query
TaxonomyRepository $taxonomyRepository
TranslatorInterface $translator
Canonical $canonical
ContentHelper $contentHelper
Notifications $notifications
Sanitiser $sanitiser

array getFilters()

{@inheritdoc}

Return Value

array

array getFunctions()

{@inheritdoc}

Return Value

array

string getAnyTitle(Content $content, int $length = 120)

Parameters

Content $content
int $length

Return Value

string

string getTitle(Content $content, string $locale = '', int $length = 120)

Parameters

Content $content
string $locale
int $length

Return Value

string

array getTitleFieldsNames(Content $content)

Parameters

Content $content

Return Value

array

ImageField|array|null getImage(Content|null $content, bool $onlyValues = false)

Parameters

Content|null $content
bool $onlyValues

Return Value

ImageField|array|null

string getExcerpt($content, int $length = 280, bool $includeTitle = false, $focus = null)

Parameters

$content
int $length
bool $includeTitle
$focus

Return Value

string

Content|null getPreviousContent(Content $content, string $byColumn = 'id', bool $sameContentType = true)

Parameters

Content $content
string $byColumn
bool $sameContentType

Return Value

Content|null

Content|null getNextContent(Content $content, string $byColumn = 'id', bool $sameContentType = true)

Parameters

Content $content
string $byColumn
bool $sameContentType

Return Value

Content|null

bool isCurrent(Environment $env, Content $content)

Parameters

Environment $env
Content $content

Return Value

bool

void allowTwig(Environment $env, Content $content)

Parameters

Environment $env
Content $content

Return Value

void

Parameters

$contentOrTaxonomy
bool $canonical
string|null $locale

Return Value

string|null

Parameters

Content $content

Return Value

string|null

Parameters

Content $content
bool $absolute

Return Value

string|null

Parameters

Content $content
bool $absolute

Return Value

string|null

Parameters

Content $content
bool $absolute

Return Value

string|null

Collection getTaxonomies(Content $content)

Parameters

Content $content

Return Value

Collection

Collection getListTemplates(TemplateselectField $field)

Parameters

TemplateselectField $field

Return Value

Collection

pager(Environment $twig, Pagerfanta $records = null, string $template = '@bolt/helpers/_pager_basic.html.twig', string $class = 'pagination', int $surround = 3)

Parameters

Environment $twig
Pagerfanta $records
string $template
string $class
int $surround

Collection selectOptions(SelectField $field)

Parameters

SelectField $field

Return Value

Collection

Collection taxonomyOptions(Collection $taxonomy)

Parameters

Collection $taxonomy

Return Value

Collection

Collection taxonomyValues(Collection $current, Collection $taxonomy)

Parameters

Collection $current
Collection $taxonomy

Return Value

Collection

string icon(Content|null $record = null, string $icon = 'question-circle')

Parameters

Content|null $record
string $icon

Return Value

string

bool hasPath(Content $record, string $path)

Parameters

Content $record
string $path

Return Value

bool

statusOptions(Content $record)

Parameters

Content $record

string getSpecialFeature(Content $record)

Parameters

Content $record

Return Value

string

bool isHomepage(Content $content)

Parameters

Content $content

Return Value

bool

bool is404(Content $content)

Parameters

Content $content

Return Value

bool

bool is403(Content $content)

Parameters

Content $content

Return Value

bool

bool isMaintenance(Content $content)

Parameters

Content $content

Return Value

bool

bool isHomepageListing(ContentType $contentType)

Parameters

ContentType $contentType

Return Value

bool

sanitise(string $html)

Parameters

string $html