Overview

Namespaces

  • Charcoal
    • Admin
      • Widget
        • Cms
    • Cms
      • Config
      • Mixin
        • Traits
      • Route
      • Section
      • Service
        • Loader
        • Manager
      • ServiceProvider
      • Support
        • Helpers
        • Interfaces
        • Traits
    • Property

Traits

  • DateHelperAwareTrait
  • EventManagerAwareTrait
  • NewsManagerAwareTrait
  • SectionLoaderAwareTrait
  • Overview
  • Namespace
  • Class

Trait SectionLoaderAwareTrait

Namespace: Charcoal\Cms\Support\Traits
Located at Charcoal/Cms/Support/Traits/SectionLoaderAwareTrait.php
Methods summary
abstract public mixed
# setContextObject( Charcoal\Model\ModelInterface $context )

Must call section if the context object is of type Section.

Must call section if the context object is of type Section.

Parameters

$context
The current context.

Returns

mixed
public ArrayAccess|Traversable
# sections( )

Returns

ArrayAccess|Traversable
public ArrayAccess|Traversable
# masterSections( )

Returns

ArrayAccess|Traversable
public ArrayAccess|Traversable
# childrenSections( )

Returns

ArrayAccess|Traversable
public string
# routes( )

Gets latest route for the given slug.

Gets latest route for the given slug.

Returns

string
The latest url.
public array|Charcoal\Cms\SectionInterface
# currentSection( boolean $raw = false )

Gets the current section based on AbstractTemplate::Section and context.

Gets the current section based on AbstractTemplate::Section and context.

Parameters

$raw
Option the receive the non-formatted section.

Returns

array|Charcoal\Cms\SectionInterface
public Charcoal\Cms\SectionInterface|array
# sectionFromSlug( string $slug )

Parameters

$slug
The section slug to load from.

Returns

Charcoal\Cms\SectionInterface|array
protected Charcoal\Cms\SectionInterface
# section( )

Returns

Charcoal\Cms\SectionInterface
protected Charcoal\Cms\Support\Traits\SectionLoaderAwareTrait
# setSection( Charcoal\Cms\SectionInterface $section )

Parameters

$section
The current section.

Returns

Charcoal\Cms\Support\Traits\SectionLoaderAwareTrait
protected Charcoal\Cms\Service\Loader\SectionLoader
# sectionLoader( )

Returns

Charcoal\Cms\Service\Loader\SectionLoader

Throws

Slim\Exception\ContainerException
When dependency is missing.
protected Charcoal\Cms\Support\Traits\SectionLoaderAwareTrait
# setSectionLoader( Charcoal\Cms\Service\Loader\SectionLoader $loader )

Parameters

$loader
The section loader.

Returns

Charcoal\Cms\Support\Traits\SectionLoaderAwareTrait
protected array
# formatSection( Charcoal\Cms\SectionInterface $section )

Parameters

$section
The section to format.

Returns

array
API documentation generated by ApiGen