class Illuminate / View / Component
You are viewing an older version of the documentation. For the latest, please visit master documentation.
abstract

Component

Properties

protected static

$propertyCache array

The cache of public property names, keyed by class.

Default: []
protected static

$methodCache array

The cache of public method names, keyed by class.

Default: []
protected

$except array

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

Default: []
public

$componentName string

The component alias name.

Default: null
public

$attributes ComponentAttributeBag

The component attributes.

Default: null

Methods

public abstract

render ( ) : View |Htmlable |Closure |string

Get the view / view contents that represent the component.

public

resolveView ( ) : View |Htmlable |Closure |string

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

protected

createBladeViewFromString ( $factory , $contents ) : string

Create a Blade view with the raw component string content.

Parameters

public

data ( ) : array

Get the data that should be supplied to the view.

protected

extractPublicProperties ( ) : array

Extract the public properties for the component.

protected

extractPublicMethods ( ) : array

Extract the public methods for the component.

protected

createVariableFromMethod ( ReflectionMethod $method ) : mixed

Create a callable variable from the given method.

Parameters

protected

createInvokableVariable ( string $method ) : InvokableComponentVariable

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

Parameters

  • $method string
protected

shouldIgnore ( $name ) : bool

Determine if the given property / method should be ignored.

Parameters

  • $name string
protected

ignoredMethods ( ) : array

Get the methods that should be ignored.

public

withName ( $name ) : $this

Set the component alias name.

Parameters

  • $name string
public

withAttributes ( array $attributes ) : $this

Set the extra attributes that the component should make available.

Parameters

  • $attributes array
protected

newAttributeBag ( array $attributes ) : ComponentAttributeBag

Get a new attribute bag instance.

Parameters

  • $attributes array
public

shouldRender ( ) : bool

Determine if the component should be rendered.