BladeCompiler
Extends
Implements
Uses
- CompilesAuthorizations
- CompilesClasses
- CompilesComments
- CompilesComponents
- CompilesConditionals
- CompilesEchos
- CompilesErrors
- CompilesHelpers
- CompilesIncludes
- CompilesInjections
- CompilesJson
- CompilesJs
- CompilesLayouts
- CompilesLoops
- CompilesRawPhp
- CompilesStacks
- CompilesTranslations
- ReflectsClosures
Properties
$extensions array
All of the registered extensions.
$customDirectives array
All custom "directive" handlers.
$conditions array
All custom "condition" handlers.
$precompilers array
All of the registered precompilers.
$path string
The file currently being compiled.
$compilers string[]
All of the available compiler functions.
$rawTags string[]
Array of opening and closing tags for raw echos.
$contentTags string[]
Array of opening and closing tags for regular echos.
$escapedTags string[]
Array of opening and closing tags for escaped echos.
$echoFormat string
The "regular" / legacy echo string format.
$footer array
Array of footer lines to be added to the template.
$rawBlocks array
Array to temporarily store the raw blocks found in the template.
$classComponentAliases array
The array of class component aliases and their class names.
$classComponentNamespaces array
The array of class component namespaces to autoload from.
$compilesComponentTags bool
Indicates if component tags should be compiled.
Methods
compile ( $path ) : void
Compile the view at the given path.
Parameters
- $path string|null
appendFilePath ( $contents ) : string
Append the file path to the compiled string.
Parameters
- $contents string
getOpenAndClosingPhpTokens ( $contents ) : Collection
Get the open and closing PHP tag tokens from the given string.
Parameters
- $contents string
getPath ( ) : string
Get the path currently being compiled.
setPath ( $path ) : void
Set the path currently being compiled.
Parameters
- $path string
compileString ( $value ) : string
Compile the given Blade template contents.
Parameters
- $value string
render ( $string , $data , $deleteCachedView ) : string
Evaluate and render a Blade string to HTML.
Parameters
- $string string
- $data array
- $deleteCachedView bool
renderComponent ( Component $component ) : string
Render a component instance to HTML.
Parameters
- $component Component
storeUncompiledBlocks ( $value ) : string
Store the blocks that do not receive compilation.
Parameters
- $value string
storeVerbatimBlocks ( $value ) : string
Store the verbatim blocks and replace them with a temporary placeholder.
Parameters
- $value string
storePhpBlocks ( $value ) : string
Store the PHP blocks and replace them with a temporary placeholder.
Parameters
- $value string
storeRawBlock ( $value ) : string
Store a raw block and return a unique raw placeholder.
Parameters
- $value string
compileComponentTags ( $value ) : string
Compile the component tags.
Parameters
- $value string
restoreRawContent ( $result ) : string
Replace the raw placeholders with the original code stored in the raw blocks.
Parameters
- $result string
getRawPlaceholder ( $replace ) : string
Get a placeholder to temporarily mark the position of raw blocks.
Parameters
- $replace int|string
addFooters ( $result ) : string
Add the stored footers onto the given content.
Parameters
- $result string
parseToken ( $token ) : string
Parse the tokens from the template.
Parameters
- $token array
compileExtensions ( $value ) : string
Execute the user defined extensions.
Parameters
- $value string
compileStatements ( $value ) : string
Compile Blade statements that start with "@".
Parameters
- $value string
compileStatement ( $match ) : string
Compile a single Blade @ statement.
Parameters
- $match array
callCustomDirective ( $name , $value ) : string
Call the given directive with the given value.
Parameters
- $name string
- $value string|null
stripParentheses ( $expression ) : string
Strip the parentheses from the given expression.
Parameters
- $expression string
extend ( callable $compiler ) : void
Register a custom Blade compiler.
Parameters
- $compiler callable
getExtensions ( ) : array
Get the extensions used by the compiler.
if ( $name , callable $callback ) : void
Register an "if" statement directive.
Parameters
- $name string
- $callback callable
check ( $name , $parameters ) : bool
Check the result of a condition.
Parameters
- $name string
- $parameters array
component ( $class , $alias , $prefix ) : void
Register a class-based component alias directive.
Parameters
- $class string
- $alias string|null
- $prefix string
components ( array $components , $prefix ) : void
Register an array of class-based components.
Parameters
- $components array
- $prefix string
getClassComponentAliases ( ) : array
Get the registered class component aliases.
componentNamespace ( $namespace , $prefix ) : void
Register a class-based component namespace.
Parameters
- $namespace string
- $prefix string
getClassComponentNamespaces ( ) : array
Get the registered class component namespaces.
aliasComponent ( $path , $alias ) : void
Register a component alias directive.
Parameters
- $path string
- $alias string|null
include ( $path , $alias ) : void
Register an include alias directive.
Parameters
- $path string
- $alias string|null
aliasInclude ( $path , $alias ) : void
Register an include alias directive.
Parameters
- $path string
- $alias string|null
directive ( $name , callable $handler ) : void
Register a handler for custom directives.
Parameters
- $name string
- $handler callable
getCustomDirectives ( ) : array
Get the list of custom directives.
precompiler ( callable $precompiler ) : void
Register a new precompiler.
Parameters
- $precompiler callable
setEchoFormat ( $format ) : void
Set the echo format to be used by the compiler.
Parameters
- $format string
withDoubleEncoding ( ) : void
Set the "echo" format to double encode entities.
withoutDoubleEncoding ( ) : void
Set the "echo" format to not double encode entities.
withoutComponentTags ( ) : void
Indicate that component tags should not be compiled.