class View extends Facade (View source)

Properties

static protected Application|null $app

The application instance being facaded.

from  Facade
static protected array $resolvedInstance

The resolved object instances.

from  Facade
static protected bool $cached

Indicates if the resolved instance should be cached.

from  Facade

Methods

static void
resolved(Closure $callback)

Run a Closure when the facade has been resolved.

from  Facade
static MockInterface
spy()

Convert the facade into a Mockery spy.

from  Facade
static MockInterface
partialMock()

Initiate a partial mock on the facade.

from  Facade
static Expectation
shouldReceive()

Initiate a mock expectation on the facade.

from  Facade
static Expectation
expects()

Initiate a mock expectation on the facade.

from  Facade
static MockInterface
createFreshMockInstance()

Create a fresh mock instance for the given class.

from  Facade
static MockInterface
createMock()

Create a fresh mock instance for the given class.

from  Facade
static bool
isMock()

Determines whether a mock is set as the instance of the facade.

from  Facade
static string|null
getMockableClass()

Get the mockable class for the bound instance.

from  Facade
static void
swap(mixed $instance)

Hotswap the underlying instance behind the facade.

from  Facade
static bool
isFake()

Determines whether a "fake" has been set as the facade instance.

from  Facade
static mixed
getFacadeRoot()

Get the root object behind the facade.

from  Facade
static string
getFacadeAccessor()

Get the registered name of the component.

static mixed
resolveFacadeInstance(string $name)

Resolve the facade root instance from the container.

from  Facade
static void
clearResolvedInstance(string $name)

Clear a resolved facade instance.

from  Facade
static void
clearResolvedInstances()

Clear all of the resolved instances.

from  Facade
static Collection
defaultAliases()

Get the application default aliases.

from  Facade
static Application|null
getFacadeApplication()

Get the application instance behind the facade.

from  Facade
static void
setFacadeApplication(Application|null $app)

Set the application instance.

from  Facade
static mixed
__callStatic(string $method, array $args)

Handle dynamic, static calls to the object.

from  Facade
static View
file(string $path, Arrayable|array $data = [], array $mergeData = [])

No description

static View
make(string $view, Arrayable|array $data = [], array $mergeData = [])

No description

static View
first(array $views, Arrayable|array $data = [], array $mergeData = [])

No description

static string
renderWhen(bool $condition, string $view, Arrayable|array $data = [], array $mergeData = [])

No description

static string
renderUnless(bool $condition, string $view, Arrayable|array $data = [], array $mergeData = [])

No description

static string
renderEach(string $view, array $data, string $iterator, string $empty = 'raw|')

No description

static bool
exists(string $view)

No description

static Engine
getEngineFromPath(string $path)

No description

static mixed
share(array|string $key, mixed|null $value = null)

No description

static void
incrementRender()

No description

static void
decrementRender()

No description

static bool
doneRendering()

No description

static bool
hasRenderedOnce(string $id)

No description

static void
markAsRenderedOnce(string $id)

No description

static void
addLocation(string $location)

No description

static void
prependLocation(string $location)

No description

static Factory
addNamespace(string $namespace, string|array $hints)

No description

static Factory
prependNamespace(string $namespace, string|array $hints)

No description

static Factory
replaceNamespace(string $namespace, string|array $hints)

No description

static void
addExtension(string $extension, string $engine, Closure|null $resolver = null)

No description

static void
flushState()

No description

static void
flushStateIfDoneRendering()

No description

static array
getExtensions()

No description

static EngineResolver
getEngineResolver()

No description

getFinder()

No description

static void
setFinder(ViewFinderInterface $finder)

No description

static void
flushFinderCache()

No description

static Dispatcher
getDispatcher()

No description

static void
setDispatcher(Dispatcher $events)

No description

static Container
getContainer()

No description

static void
setContainer(Container $container)

No description

static mixed
shared(string $key, mixed $default = null)

No description

static array
getShared()

No description

static void
macro(string $name, object|callable $macro)

No description

static void
mixin(object $mixin, bool $replace = true)

No description

static bool
hasMacro(string $name)

No description

static void
flushMacros()

No description

static void
startComponent(Closure|string $view, array $data = [])

No description

static void
startComponentFirst(array $names, array $data = [])

No description

static string
renderComponent()

No description

static mixed|null
getConsumableComponentData(string $key, mixed $default = null)

No description

static void
slot(string $name, string|null $content = null, array $attributes = [])

No description

static void
endSlot()

No description

static array
creator(array|string $views, Closure|string $callback)

No description

static array
composers(array $composers)

No description

static array
composer(array|string $views, Closure|string $callback)

No description

static void
callComposer(View $view)

No description

static void
callCreator(View $view)

No description

static void
startFragment(string $fragment)

No description

static string
stopFragment()

No description

static mixed
getFragment(string $name, string|null $default = null)

No description

static array
getFragments()

No description

static void
flushFragments()

No description

static void
startSection(string $section, string|null $content = null)

No description

static void
inject(string $section, string $content)

No description

static string
yieldSection()

No description

static string
stopSection(bool $overwrite = false)

No description

static string
appendSection()

No description

static string
yieldContent(string $section, string $default = '')

No description

static string
parentPlaceholder(string $section = '')

No description

static bool
hasSection(string $name)

No description

static bool
sectionMissing(string $name)

No description

static mixed
getSection(string $name, string|null $default = null)

No description

static array
getSections()

No description

static void
flushSections()

No description

static void
addLoop(Countable|array $data)

No description

static void
incrementLoopIndices()

No description

static void
popLoop()

No description

static stdClass|null
getLastLoop()

No description

static array
getLoopStack()

No description

static void
startPush(string $section, string $content = '')

No description

static string
stopPush()

No description

static void
startPrepend(string $section, string $content = '')

No description

static string
stopPrepend()

No description

static string
yieldPushContent(string $section, string $default = '')

No description

static void
flushStacks()

No description

static void
startTranslation(array $replacements = [])

No description

static string
renderTranslation()

No description

Details

static void resolved(Closure $callback)

Run a Closure when the facade has been resolved.

Parameters

Closure $callback

Return Value

void

static MockInterface spy()

Convert the facade into a Mockery spy.

Return Value

MockInterface

static MockInterface partialMock()

Initiate a partial mock on the facade.

Return Value

MockInterface

static Expectation shouldReceive()

Initiate a mock expectation on the facade.

Return Value

Expectation

static Expectation expects()

Initiate a mock expectation on the facade.

Return Value

Expectation

static protected MockInterface createFreshMockInstance()

Create a fresh mock instance for the given class.

Return Value

MockInterface

static protected MockInterface createMock()

Create a fresh mock instance for the given class.

Return Value

MockInterface

static protected bool isMock()

Determines whether a mock is set as the instance of the facade.

Return Value

bool

static protected string|null getMockableClass()

Get the mockable class for the bound instance.

Return Value

string|null

static void swap(mixed $instance)

Hotswap the underlying instance behind the facade.

Parameters

mixed $instance

Return Value

void

static bool isFake()

Determines whether a "fake" has been set as the facade instance.

Return Value

bool

static mixed getFacadeRoot()

Get the root object behind the facade.

Return Value

mixed

static protected string getFacadeAccessor()

Get the registered name of the component.

Return Value

string

static protected mixed resolveFacadeInstance(string $name)

Resolve the facade root instance from the container.

Parameters

string $name

Return Value

mixed

static void clearResolvedInstance(string $name)

Clear a resolved facade instance.

Parameters

string $name

Return Value

void

static void clearResolvedInstances()

Clear all of the resolved instances.

Return Value

void

static Collection defaultAliases()

Get the application default aliases.

Return Value

Collection

static Application|null getFacadeApplication()

Get the application instance behind the facade.

Return Value

Application|null

static void setFacadeApplication(Application|null $app)

Set the application instance.

Parameters

Application|null $app

Return Value

void

static mixed __callStatic(string $method, array $args)

Handle dynamic, static calls to the object.

Parameters

string $method
array $args

Return Value

mixed

Exceptions

RuntimeException

static View file(string $path, Arrayable|array $data = [], array $mergeData = [])

No description

Parameters

string $path
Arrayable|array $data
array $mergeData

Return Value

View

static View make(string $view, Arrayable|array $data = [], array $mergeData = [])

No description

Parameters

string $view
Arrayable|array $data
array $mergeData

Return Value

View

static View first(array $views, Arrayable|array $data = [], array $mergeData = [])

No description

Parameters

array $views
Arrayable|array $data
array $mergeData

Return Value

View

static string renderWhen(bool $condition, string $view, Arrayable|array $data = [], array $mergeData = [])

No description

Parameters

bool $condition
string $view
Arrayable|array $data
array $mergeData

Return Value

string

static string renderUnless(bool $condition, string $view, Arrayable|array $data = [], array $mergeData = [])

No description

Parameters

bool $condition
string $view
Arrayable|array $data
array $mergeData

Return Value

string

static string renderEach(string $view, array $data, string $iterator, string $empty = 'raw|')

No description

Parameters

string $view
array $data
string $iterator
string $empty

Return Value

string

static bool exists(string $view)

No description

Parameters

string $view

Return Value

bool

static Engine getEngineFromPath(string $path)

No description

Parameters

string $path

Return Value

Engine

static mixed share(array|string $key, mixed|null $value = null)

No description

Parameters

array|string $key
mixed|null $value

Return Value

mixed

static void incrementRender()

No description

Return Value

void

static void decrementRender()

No description

Return Value

void

static bool doneRendering()

No description

Return Value

bool

static bool hasRenderedOnce(string $id)

No description

Parameters

string $id

Return Value

bool

static void markAsRenderedOnce(string $id)

No description

Parameters

string $id

Return Value

void

static void addLocation(string $location)

No description

Parameters

string $location

Return Value

void

static void prependLocation(string $location)

No description

Parameters

string $location

Return Value

void

static Factory addNamespace(string $namespace, string|array $hints)

No description

Parameters

string $namespace
string|array $hints

Return Value

Factory

static Factory prependNamespace(string $namespace, string|array $hints)

No description

Parameters

string $namespace
string|array $hints

Return Value

Factory

static Factory replaceNamespace(string $namespace, string|array $hints)

No description

Parameters

string $namespace
string|array $hints

Return Value

Factory

static void addExtension(string $extension, string $engine, Closure|null $resolver = null)

No description

Parameters

string $extension
string $engine
Closure|null $resolver

Return Value

void

static void flushState()

No description

Return Value

void

static void flushStateIfDoneRendering()

No description

Return Value

void

static array getExtensions()

No description

Return Value

array

static EngineResolver getEngineResolver()

No description

Return Value

EngineResolver

static ViewFinderInterface getFinder()

No description

Return Value

ViewFinderInterface

static void setFinder(ViewFinderInterface $finder)

No description

Parameters

ViewFinderInterface $finder

Return Value

void

static void flushFinderCache()

No description

Return Value

void

static Dispatcher getDispatcher()

No description

Return Value

Dispatcher

static void setDispatcher(Dispatcher $events)

No description

Parameters

Dispatcher $events

Return Value

void

static Container getContainer()

No description

Return Value

Container

static void setContainer(Container $container)

No description

Parameters

Container $container

Return Value

void

static mixed shared(string $key, mixed $default = null)

No description

Parameters

string $key
mixed $default

Return Value

mixed

static array getShared()

No description

Return Value

array

static void macro(string $name, object|callable $macro)

No description

Parameters

string $name
object|callable $macro

Return Value

void

static void mixin(object $mixin, bool $replace = true)

No description

Parameters

object $mixin
bool $replace

Return Value

void

static bool hasMacro(string $name)

No description

Parameters

string $name

Return Value

bool

static void flushMacros()

No description

Return Value

void

static void startComponent(Closure|string $view, array $data = [])

No description

Parameters

Closure|string $view
array $data

Return Value

void

static void startComponentFirst(array $names, array $data = [])

No description

Parameters

array $names
array $data

Return Value

void

static string renderComponent()

No description

Return Value

string

static mixed|null getConsumableComponentData(string $key, mixed $default = null)

No description

Parameters

string $key
mixed $default

Return Value

mixed|null

static void slot(string $name, string|null $content = null, array $attributes = [])

No description

Parameters

string $name
string|null $content
array $attributes

Return Value

void

static void endSlot()

No description

Return Value

void

static array creator(array|string $views, Closure|string $callback)

No description

Parameters

array|string $views
Closure|string $callback

Return Value

array

static array composers(array $composers)

No description

Parameters

array $composers

Return Value

array

static array composer(array|string $views, Closure|string $callback)

No description

Parameters

array|string $views
Closure|string $callback

Return Value

array

static void callComposer(View $view)

No description

Parameters

View $view

Return Value

void

static void callCreator(View $view)

No description

Parameters

View $view

Return Value

void

static void startFragment(string $fragment)

No description

Parameters

string $fragment

Return Value

void

static string stopFragment()

No description

Return Value

string

static mixed getFragment(string $name, string|null $default = null)

No description

Parameters

string $name
string|null $default

Return Value

mixed

static array getFragments()

No description

Return Value

array

static void flushFragments()

No description

Return Value

void

static void startSection(string $section, string|null $content = null)

No description

Parameters

string $section
string|null $content

Return Value

void

static void inject(string $section, string $content)

No description

Parameters

string $section
string $content

Return Value

void

static string yieldSection()

No description

Return Value

string

static string stopSection(bool $overwrite = false)

No description

Parameters

bool $overwrite

Return Value

string

static string appendSection()

No description

Return Value

string

static string yieldContent(string $section, string $default = '')

No description

Parameters

string $section
string $default

Return Value

string

static string parentPlaceholder(string $section = '')

No description

Parameters

string $section

Return Value

string

static bool hasSection(string $name)

No description

Parameters

string $name

Return Value

bool

static bool sectionMissing(string $name)

No description

Parameters

string $name

Return Value

bool

static mixed getSection(string $name, string|null $default = null)

No description

Parameters

string $name
string|null $default

Return Value

mixed

static array getSections()

No description

Return Value

array

static void flushSections()

No description

Return Value

void

static void addLoop(Countable|array $data)

No description

Parameters

Countable|array $data

Return Value

void

static void incrementLoopIndices()

No description

Return Value

void

static void popLoop()

No description

Return Value

void

static stdClass|null getLastLoop()

No description

Return Value

stdClass|null

static array getLoopStack()

No description

Return Value

array

static void startPush(string $section, string $content = '')

No description

Parameters

string $section
string $content

Return Value

void

static string stopPush()

No description

Return Value

string

static void startPrepend(string $section, string $content = '')

No description

Parameters

string $section
string $content

Return Value

void

static string stopPrepend()

No description

Return Value

string

static string yieldPushContent(string $section, string $default = '')

No description

Parameters

string $section
string $default

Return Value

string

static void flushStacks()

No description

Return Value

void

static void startTranslation(array $replacements = [])

No description

Parameters

array $replacements

Return Value

void

static string renderTranslation()

No description

Return Value

string