AnonymousComponent

class AnonymousComponent 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
protected string $view The component view.
protected array $data The component data.

Methods

View|Htmlable|Closure|string render()

Get the view / view contents that represent the component.

View|Htmlable|Closure|string resolveView()

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

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.

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
bool shouldRender()

Determine if the component should be rendered.

from Component
void __construct(string $view, array $data)

Create a new anonymous component instance.

Details

View|Htmlable|Closure|string render()

Get the view / 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

bool shouldRender()

Determine if the component should be rendered.

Return Value

bool

void __construct(string $view, array $data)

Create a new anonymous component instance.

Parameters

string $view
array $data

Return Value

void

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/View/AnonymousComponent.html