Block
class Block (View source)
Constants
SOURCE_APP |
|
SOURCE_TWILL |
|
SOURCE_CUSTOM |
|
TYPE_BLOCK |
|
TYPE_REPEATER |
|
PREG_REPLACE_INNER |
|
Properties
string | $title | ||
string | $titleField | ||
bool | $hideTitlePrefix | ||
string | $trigger | ||
string | $source | ||
string | $name | ||
string | $group | ||
string | $type | ||
string | $icon | ||
bool | $compiled | ||
string | $component | ||
int | $max | ||
bool | $isNewFormat | ||
SplFileInfo | $file | ||
string | $fileName | ||
string | $renderNamespace | ||
string | $contents | ||
array | $rules | ||
array | $rulesForTranslatedFields |
Methods
Make a block instance out of arguments.
Gets the first match being a block or repeater.
No description
No description
Block constructor.
No description
Gets the form data. This is only called once and not per create.
No description
No description
No description
No description
Checks both the blade file or helper class for validation rules. Returns in order the first one with data.
Checks both the blade file or helper class for validation rules. Returns in order the first one with data.
Parse a string property directive in the form of @twillTypeProperty('value')
.
Parse an array property directive in the form of @twillTypeProperty([...])
and pass the result to a given callback.
Parse a mixed property directive in the form of @twillTypeProperty('value', [...])
and pass the result to a given callback.
No description
No description
No description
No description
No description
Details
static Block
make($file, $type, $source, $name = null, string $renderNamespace = null)
Make a block instance out of arguments.
static Block|null
findFirstWithType(string $type)
Gets the first match being a block or repeater.
static Block
getForType(string $type, bool $repeater = false)
No description
static Block
getForComponent(string $type, bool $repeater = false)
No description
__construct(SplFileInfo $file, $type, $source, $name = null, string|null $renderNamespace = null)
Block constructor.
$this
setSource($source)
No description
array
getData(array $data, Block $block)
No description
array
getFormData()
Gets the form data. This is only called once and not per create.
This function is not aware of the context. If you need to know the current module you have to figure that out yourself by for example parsing the route.
Collection
toList()
No description
Collection
toShortList()
No description
string
makeName($name)
No description
$this
parse()
No description
array
getRules()
Checks both the blade file or helper class for validation rules. Returns in order the first one with data.
array
getRulesForTranslatedFields()
Checks both the blade file or helper class for validation rules. Returns in order the first one with data.
string
parseProperty(string $property, string $block, string $blockName, string|null $default = null)
Parse a string property directive in the form of @twillTypeProperty('value')
.
void
parseArrayProperty(string $property, string $block, string $blockName, callable $callback)
Parse an array property directive in the form of @twillTypeProperty([...])
and pass the result to a given callback.
mixed
parseMixedProperty(string $property, string $block, string $blockName, callable $callback)
Parse a mixed property directive in the form of @twillTypeProperty('value', [...])
and pass the result to a given callback.
bool
isNewFormat($block)
No description
string
getFileName()
No description
string
render()
No description
static string
removeSpecialBladeTags($contents)
No description
getBlockView($blockViewMappings = [])
No description