class DynamicComponent extends Component (View source)
| 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 |
| static protected Factory|null | $factory | The view factory instance, if any. | from Component |
| static protected | $componentsResolver | The component resolver callback. | from Component |
| static protected array<string,string> | $bladeViewCache | The cache of blade view names, keyed by contents. | from Component |
| 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 |
| static protected array<class-string,array<int,string>> | $constructorParametersCache | The cache of constructor parameters, keyed by class. | from Component |
| static protected array | $ignoredParameterNames | The cache of ignored parameter names. | 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. |
| View|Htmlable|Closure|string | render()
Get the view / contents that represent the component. | |
| static Component | resolve(array $data)
Resolve the component instance with the given data. | from Component |
| static array | extractConstructorParameters()
Extract the constructor parameters for the component. | from Component |
| View|Htmlable|Closure|string | resolveView()
Resolve the Blade view or view file that should be used when rendering the component. | from Component |
| string | extractBladeViewFromString(string $contents)
Create a Blade view with the raw component string content. | from Component |
| string | createBladeViewFromString(Factory $factory, string $contents)
Create a Blade view with the raw component string content. | from Component |
| array | data()
Get the data that should be supplied to the view. | from Component |
| array | extractPublicProperties()
Extract the public properties for the component. | from Component |
| array | extractPublicMethods()
Extract the public methods for the component. | from Component |
| mixed | createVariableFromMethod(ReflectionMethod $method)
Create a callable variable from the given method. | from Component |
| InvokableComponentVariable | createInvokableVariable(string $method)
Create an invokable, toStringable variable for the given component method. | from Component |
| bool | shouldIgnore(string $name)
Determine if the given property / method should be ignored. | from Component |
| array | ignoredMethods()
Get the methods that should be ignored. | from Component |
| $this | withName(string $name)
Set the component alias name. | from Component |
| $this | withAttributes(array $attributes)
Set the extra attributes that the component should make available. | from Component |
| ComponentAttributeBag | newAttributeBag(array $attributes = [])
Get a new attribute bag instance. | from Component |
| bool | shouldRender()
Determine if the component should be rendered. | from Component |
| View | view(string|null $view, Arrayable|array $data = [], array $mergeData = [])
Get the evaluated view contents for the given view. | from Component |
| Factory | factory()
Get the view factory instance. | from Component |
| static array | ignoredParameterNames()
Get the cached set of anonymous component constructor parameter names to exclude. | from Component |
| static void | flushCache()
Flush the component's cached state. | from Component |
| static void | forgetFactory()
Forget the component's factory instance. | from Component |
| static void | forgetComponentsResolver()
Forget the component's resolver callback. | from Component |
| static void | resolveComponentsUsing($resolver)
Set the callback that should be used to resolve components within views. | from Component |
| 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. | |
| ComponentTagCompiler | compiler()
Get an instance of the Blade tag compiler. |
Resolve the component instance with the given data.
Extract the constructor parameters for the component.
Resolve the Blade view or view file that should be used when rendering the component.
Create a Blade view with the raw component string content.
Create a Blade view with the raw component string content.
Get the data that should be supplied to the view.
Extract the public properties for the component.
Extract the public methods for the component.
Create a callable variable from the given method.
Create an invokable, toStringable variable for the given component method.
Determine if the given property / method should be ignored.
Get the methods that should be ignored.
Set the component alias name.
Set the extra attributes that the component should make available.
Get a new attribute bag instance.
Determine if the component should be rendered.
Get the evaluated view contents for the given view.
Get the view factory instance.
Get the cached set of anonymous component constructor parameter names to exclude.
Flush the component's cached state.
Forget the component's factory instance.
| internal |
Forget the component's resolver callback.
| internal |
Set the callback that should be used to resolve components within views.
Create a new component instance.
Compile the @props directive for the component.
Compile the bindings for the component.
Compile the slots for the component.
Get the class for the current component.
Get the names of the variables that should be bound to the component.
Get an instance of the Blade tag compiler.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/11.x/Illuminate/View/DynamicComponent.html