TwillBlocks
class TwillBlocks (View source)
Constants
DIRECTORY_TYPE_VENDOR |
|
Properties
static array<string,string> | $blockDirectories | ||
static array<string,string> | $repeatersDirectories |
Methods
Registers a blocks directory.
Registers a repeaters directory.
Only when the block collection is actually requested we parse all the information.
No description
No description
Gets all blocks and repeaters.
No description
No description
Gets the collection of Block objects from a given directory.
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
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.
Block|null
findByName(string $name)
No description
Block|null
findRepeaterByName(string $name)
No description
Collection
getAll()
Gets all blocks and repeaters.
Collection
getBlocks()
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.