class DynamicComponent extends Component (View source)

Properties

static protected array $propertyCache

The cache of public property names, keyed by class.

from  Component
static protected array $methodCache

The cache of public method names, keyed by class.

from  Component
protected array $except

The properties / methods that should not be exposed to the component.

from  Component
string $componentName

The component alias name.

from  Component
ComponentAttributeBag $attributes

The component attributes.

from  Component
string $component

The name of the component.

static protected BladeTagCompiler $compiler

The component tag compiler instance.

static protected array $componentClasses

The cached component classes.

Methods

render()

Get the view / contents that represent the component.

resolveView()

Resolve the Blade view or view file that should be used when rendering the component.

string
createBladeViewFromString(Factory $factory, string $contents)

Create a Blade view with the raw component string content.

array
data()

Get the data that should be supplied to the view.

array
extractPublicProperties()

Extract the public properties for the component.

array
extractPublicMethods()

Extract the public methods for the component.

mixed
createVariableFromMethod(ReflectionMethod $method)

Create a callable variable from the given method.

createInvokableVariable(string $method)

Create an invokable, toStringable variable for the given component method.

bool
shouldIgnore(string $name)

Determine if the given property / method should be ignored.

array
ignoredMethods()

Get the methods that should be ignored.

$this
withName(string $name)

Set the component alias name.

$this
withAttributes(array $attributes)

Set the extra attributes that the component should make available.

newAttributeBag(array $attributes = [])

Get a new attribute bag instance.

bool
shouldRender()

Determine if the component should be rendered.

void
__construct(string $component)

Create a new component instance.

string
compileProps(array $bindings)

Compile the @props directive for the component.

string
compileBindings(array $bindings)

Compile the bindings for the component.

string
compileSlots(array $slots)

Compile the slots for the component.

string
classForComponent()

Get the class for the current component.

array
bindings(string $class)

Get the names of the variables that should be bound to the component.

compiler()

Get an instance of the Blade tag compiler.

Details

View|Htmlable|Closure|string render()

Get the view / contents that represent the component.

Return Value

View|Htmlable|Closure|string

View|Htmlable|Closure|string resolveView()

Resolve the Blade view or view file that should be used when rendering the component.

Return Value

View|Htmlable|Closure|string

protected string createBladeViewFromString(Factory $factory, string $contents)

Create a Blade view with the raw component string content.

Parameters

Factory $factory
string $contents

Return Value

string

array data()

Get the data that should be supplied to the view.

Return Value

array

protected array extractPublicProperties()

Extract the public properties for the component.

Return Value

array

protected array extractPublicMethods()

Extract the public methods for the component.

Return Value

array

protected mixed createVariableFromMethod(ReflectionMethod $method)

Create a callable variable from the given method.

Parameters

ReflectionMethod $method

Return Value

mixed

protected InvokableComponentVariable createInvokableVariable(string $method)

Create an invokable, toStringable variable for the given component method.

Parameters

string $method

Return Value

InvokableComponentVariable

protected bool shouldIgnore(string $name)

Determine if the given property / method should be ignored.

Parameters

string $name

Return Value

bool

protected array ignoredMethods()

Get the methods that should be ignored.

Return Value

array

$this withName(string $name)

Set the component alias name.

Parameters

string $name

Return Value

$this

$this withAttributes(array $attributes)

Set the extra attributes that the component should make available.

Parameters

array $attributes

Return Value

$this

protected ComponentAttributeBag newAttributeBag(array $attributes = [])

Get a new attribute bag instance.

Parameters

array $attributes

Return Value

ComponentAttributeBag

bool shouldRender()

Determine if the component should be rendered.

Return Value

bool

void __construct(string $component)

Create a new component instance.

Parameters

string $component

Return Value

void

protected string compileProps(array $bindings)

Compile the @props directive for the component.

Parameters

array $bindings

Return Value

string

protected string compileBindings(array $bindings)

Compile the bindings for the component.

Parameters

array $bindings

Return Value

string

protected string compileSlots(array $slots)

Compile the slots for the component.

Parameters

array $slots

Return Value

string

protected string classForComponent()

Get the class for the current component.

Return Value

string

protected array bindings(string $class)

Get the names of the variables that should be bound to the component.

Parameters

string $class

Return Value

array

protected ComponentTagCompiler compiler()

Get an instance of the Blade tag compiler.

Return Value

ComponentTagCompiler