TwillBlocks
class TwillBlocks (View source)
Properties
static array<string,array> | $blockDirectories | ||
static array<string,array> | $repeatersDirectories | ||
static array<string,string> | $componentBlockNamespaces | ||
static InlineRepeater> | $dynamicRepeaters | ||
static array | $loadedDynamicRepeaters | ||
static array<string,string> | $manualBlocks |
Methods
Registers a blocks directory.
No description
No description
No description
Registers a repeaters directory.
Only when the block collection is actually requested we parse all the information.
No description
No description
No description
Gets all blocks and repeaters.
No description
No description
No description
Gets the collection of Block objects from a given directory.
Gets all the crop configs, also those of component blocks.
Details
void
registerPackageBlocksDirectory(string $path, string $renderNamespace = null)
Registers a blocks directory.
When the blockCollection is already initialized, we read the blocks and merge them in. If the blockCollection is not yet initialized, we add it to the local static so that we can process it once the collection is needed.
void
registerDynamicRepeater(string $name, InlineRepeater $repeater)
No description
void
discoverDynamicRepeaters(Collection $collection)
No description
string
getAvailableRepeaters()
No description
void
registerComponentBlocks(string $namespace, string $path)
No description
void
registerPackageRepeatersDirectory(string $path, string $renderNamespace = null)
Registers a repeaters directory.
When the blockCollection is already initialized, we read the repeaters and merge them in. If the blockCollection is not yet initialized, we add it to the local static so that we can process it once the collection is needed.
BlockCollection
getBlockCollection()
Only when the block collection is actually requested we parse all the information.
void
registerManualBlock(string $blockClass)
No description
Block|null
findByName(string $name)
No description
Block|null
findRepeaterByName(string $name)
No description
Collection
getAll()
Gets all blocks and repeaters.
Collection
getBlocks(bool $withSettingsBlocks = false)
No description
Collection
getSettingsBlocks()
No description
Collection
getRepeaters()
No description
Collection
readBlocksFromDirectory(string $directory, string $source, string $type, string|null $renderNamespace = null)
Gets the collection of Block objects from a given directory.
array
getAllCropConfigs()
Gets all the crop configs, also those of component blocks.