MMOframework
Why AI Playground Libraries Documentation Search Agency
FR EN
Index

SectionTypes

MMO\editor\cms · 1 symbol · generated 27 Oct 2026

class

SectionTypes

SectionTypes.php:16

The types of section a page can hold (SectionType): every sections/{name}.schema.json that has its sections/{name}.phtml, in the folders of Pages::$templates. A folder listed first wins: an application replaces a type of mmo.editor's own by writing one of the same name in its folder.

class MMO\editor\cms\SectionTypes
Namespace
MMO\editor\cms
$types = new SectionTypes(['{root}/templates', __DIR__ . '/../../templates']); $types->get('hero')?->getDefaults();

Properties3

extraStyles

protected string $extraStyles = ''
Type
string

folders

readonly
protected readonly array $folders
Type
array

types

protected ?array $types = null
Type
null | array

Methods10

files($folder, $suffix)

SectionTypes.php:125
protected function files(string $folder, string $suffix): array
$folderstring
$suffixstring
returnsarraythe files of $folder whose name ends with $suffix, sorted: scandir() and not glob(), which finds nothing in a phar -- a release runs its application's section types from one

getLayout($name)

SectionTypes.php:72
function getLayout(string $name): ?string
$namestringa layout's name
returnsnull | stringthe file of layouts/{name}.phtml, null if no folder has it

getStyles()

SectionTypes.php:99
function getStyles(): string
returnsstringthe css of the sections: every folder's sections/sections.css then its types' own (sections/{name}.css), mmo.editor's folder first and the application's after it, so that an application restyles the sections without writing them again

getTemplate($name)

SectionTypes.php:85
function getTemplate(string $name): ?string
$namestringa file's name, at the root of a folder (backoffice.phtml)
returnsnull | stringthe file of the first folder that has it

with($type, $styles)

SectionTypes.php:35
function with(MMO\editor\cms\SectionType $type, string $styles = ''): static
$typeSectionType
$styles = ''string
returnsstaticthese types, and $type -- which replaces one of the same name -- with $styles after the others': what the section-type editor previews before it is saved

__construct($folders)

SectionTypes.php:24
function __construct(array $folders)
$foldersarraythe template folders, the first one winning