ComponentTagCompiler
class ComponentTagCompiler (View source)
Properties
protected BladeCompiler | $blade | The Blade compiler instance. |
|
protected array | $aliases | The component class aliases. |
|
protected array | $namespaces | The component class namespaces. |
|
protected array | $boundAttributes | The "bind:" attributes that have been compiled for the current component. |
Methods
Create a new component tag compiler.
Compile the component and slot tags within the given string.
Compile the tags within the given string.
Compile the opening tags within the given string.
Compile the self-closing tags within the given string.
Compile the Blade component string for the given component and attributes.
Get the component class for a given component alias.
Find the class for the given component using the registered namespaces.
Guess the class name for the given component.
Format the class name for the given component.
Guess the view name for the given component.
Partition the data and extra attributes from the given array of attributes.
Compile the closing tags within the given string.
Compile the slot tags within the given string.
Get an array of attributes from the given attribute string.
Parse the attribute bag in a given attribute string into its fully-qualified syntax.
Parse the "bind" attributes in a given attribute string into their fully-qualified syntax.
Compile any Blade echo statements that are present in the attribute string.
Escape the single quotes in the given string that are outside of PHP blocks.
Convert an array of attributes to a string.
Strip any quotes from the given string.
Details
void
__construct(array $aliases = [], array $namespaces = [], BladeCompiler|null $blade = null)
Create a new component tag compiler.
string
compile(string $value)
Compile the component and slot tags within the given string.
string
compileTags(string $value)
Compile the tags within the given string.
protected string
compileOpeningTags(string $value)
Compile the opening tags within the given string.
protected string
compileSelfClosingTags(string $value)
Compile the self-closing tags within the given string.
protected string
componentString(string $component, array $attributes)
Compile the Blade component string for the given component and attributes.
string
componentClass(string $component)
Get the component class for a given component alias.
string|null
findClassByComponent(string $component)
Find the class for the given component using the registered namespaces.
string
guessClassName(string $component)
Guess the class name for the given component.
string
formatClassName(string $component)
Format the class name for the given component.
string
guessViewName(string $name)
Guess the view name for the given component.
array
partitionDataAndAttributes(string $class, array $attributes)
Partition the data and extra attributes from the given array of attributes.
protected string
compileClosingTags(string $value)
Compile the closing tags within the given string.
string
compileSlots(string $value)
Compile the slot tags within the given string.
protected array
getAttributesFromAttributeString(string $attributeString)
Get an array of attributes from the given attribute string.
protected string
parseAttributeBag(string $attributeString)
Parse the attribute bag in a given attribute string into its fully-qualified syntax.
protected string
parseBindAttributes(string $attributeString)
Parse the "bind" attributes in a given attribute string into their fully-qualified syntax.
protected string
compileAttributeEchos(string $attributeString)
Compile any Blade echo statements that are present in the attribute string.
These echo statements need to be converted to string concatenation statements.
protected string
escapeSingleQuotesOutsideOfPhpBlocks(string $value)
Escape the single quotes in the given string that are outside of PHP blocks.
protected string
attributesToString(array $attributes, bool $escapeBound = true)
Convert an array of attributes to a string.
string
stripQuotes(string $value)
Strip any quotes from the given string.