BladeCompiler
class BladeCompiler extends Compiler implements CompilerInterface (View source)
Properties
protected Filesystem | $files | The Filesystem instance. | from Compiler |
protected string | $cachePath | Get the cache path for the compiled views. | from Compiler |
protected array | $extensions | All of the registered extensions. | |
protected array | $customDirectives | All custom "directive" handlers. | |
protected string | $path | The file currently being compiled. | |
protected array | $compilers | All of the available compiler functions. | |
protected array | $rawTags | Array of opening and closing tags for raw echos. | |
protected array | $contentTags | Array of opening and closing tags for regular echos. | |
protected array | $escapedTags | Array of opening and closing tags for escaped echos. | |
protected string | $echoFormat | The "regular" / legacy echo string format. | |
protected array | $footer | Array of footer lines to be added to template. | |
protected string | $verbatimPlaceholder | Placeholder to temporary mark the position of verbatim blocks. | |
protected array | $verbatimBlocks | Array to temporary store the verbatim blocks found in the template. | |
protected int | $forelseCounter | Counter to keep track of nested forelse statements. |
Methods
void | __construct(Filesystem $files, string $cachePath) Create a new compiler instance. | from Compiler |
string | getCompiledPath(string $path) Get the path to the compiled version of a view. | from Compiler |
bool | isExpired(string $path) Determine if the view at the given path is expired. | from Compiler |
void | compile(string $path = null) Compile the view at the given path. | |
string | getPath() Get the path currently being compiled. | |
void | setPath(string $path) Set the path currently being compiled. | |
string | compileString(string $value) Compile the given Blade template contents. | |
string | storeVerbatimBlocks(string $value) Store the verbatim blocks and replace them with a temporary placeholder. | |
string | restoreVerbatimBlocks(string $result) Replace the raw placeholders with the original code stored in the raw blocks. | |
string | parseToken(array $token) Parse the tokens from the template. | |
string | compileExtensions(string $value) Execute the user defined extensions. | |
string | compileComments(string $value) Compile Blade comments into valid PHP. | |
string | compileEchos(string $value) Compile Blade echos into valid PHP. | |
array | getEchoMethods() Get the echo methods in the proper order for compilation. | |
mixed | compileStatements(string $value) Compile Blade statements that start with "@". | |
string | compileRawEchos(string $value) Compile the "raw" echo statements. | |
string | compileRegularEchos(string $value) Compile the "regular" echo statements. | |
string | compileEscapedEchos(string $value) Compile the escaped echo statements. | |
string | compileEchoDefaults(string $value) Compile the default values for the echo statement. | |
string | compileEach(string $expression) Compile the each statements into valid PHP. | |
string | compileInject(string $expression) Compile the inject statements into valid PHP. | |
string | compileYield(string $expression) Compile the yield statements into valid PHP. | |
string | compileShow(string $expression) Compile the show statements into valid PHP. | |
string | compileSection(string $expression) Compile the section statements into valid PHP. | |
string | compileAppend(string $expression) Compile the append statements into valid PHP. | |
string | compileEndsection(string $expression) Compile the end-section statements into valid PHP. | |
string | compileStop(string $expression) Compile the stop statements into valid PHP. | |
string | compileOverwrite(string $expression) Compile the overwrite statements into valid PHP. | |
string | compileUnless(string $expression) Compile the unless statements into valid PHP. | |
string | compileEndunless(string $expression) Compile the end unless statements into valid PHP. | |
string | compileLang(string $expression) Compile the lang statements into valid PHP. | |
string | compileChoice(string $expression) Compile the choice statements into valid PHP. | |
string | compileElse(string $expression) Compile the else statements into valid PHP. | |
string | compileFor(string $expression) Compile the for statements into valid PHP. | |
string | compileForeach(string $expression) Compile the foreach statements into valid PHP. | |
string | compileBreak(string $expression) Compile the break statements into valid PHP. | |
string | compileContinue(string $expression) Compile the continue statements into valid PHP. | |
string | compileForelse(string $expression) Compile the forelse statements into valid PHP. | |
string | compileCan(string $expression) Compile the can statements into valid PHP. | |
string | compileElsecan(string $expression) Compile the else-can statements into valid PHP. | |
string | compileCannot(string $expression) Compile the cannot statements into valid PHP. | |
string | compileElsecannot(string $expression) Compile the else-can statements into valid PHP. | |
string | compileIf(string $expression) Compile the if statements into valid PHP. | |
string | compileElseif(string $expression) Compile the else-if statements into valid PHP. | |
string | compileEmpty(string $expression) Compile the forelse statements into valid PHP. | |
string | compileHasSection(string $expression) Compile the has section statements into valid PHP. | |
string | compileWhile(string $expression) Compile the while statements into valid PHP. | |
string | compileEndwhile(string $expression) Compile the end-while statements into valid PHP. | |
string | compileEndfor(string $expression) Compile the end-for statements into valid PHP. | |
string | compileEndforeach(string $expression) Compile the end-for-each statements into valid PHP. | |
string | compileEndcan(string $expression) Compile the end-can statements into valid PHP. | |
string | compileEndcannot(string $expression) Compile the end-cannot statements into valid PHP. | |
string | compileEndif(string $expression) Compile the end-if statements into valid PHP. | |
string | compileEndforelse(string $expression) Compile the end-for-else statements into valid PHP. | |
string | compilePhp(string $expression) Compile the raw PHP statements into valid PHP. | |
string | compileEndphp(string $expression) Compile end-php statement into valid PHP. | |
string | compileUnset(string $expression) Compile the unset statements into valid PHP. | |
string | compileExtends(string $expression) Compile the extends statements into valid PHP. | |
string | compileInclude(string $expression) Compile the include statements into valid PHP. | |
string | compileIncludeIf(string $expression) Compile the include statements into valid PHP. | |
string | compileStack(string $expression) Compile the stack statements into the content. | |
string | compilePush(string $expression) Compile the push statements into valid PHP. | |
string | compileEndpush(string $expression) Compile the endpush statements into valid PHP. | |
string | stripParentheses(string $expression) Strip the parentheses from the given expression. | |
array | getExtensions() Get the extensions used by the compiler. | |
void | extend(callable $compiler) Register a custom Blade compiler. | |
string | callCustomDirective(string $name, string|null $value) Call the given directive with the given value. | |
void | directive(string $name, callable $handler) Register a handler for custom directives. | |
array | getCustomDirectives() Get the list of custom directives. | |
array | getRawTags() Gets the raw tags used by the compiler. | |
void | setRawTags(string $openTag, string $closeTag) Sets the raw tags used for the compiler. | |
void | setContentTags(string $openTag, string $closeTag, bool $escaped = false) Sets the content tags used for the compiler. | |
void | setEscapedContentTags(string $openTag, string $closeTag) Sets the escaped content tags used for the compiler. | |
string | getContentTags() Gets the content tags used for the compiler. | |
string | getEscapedContentTags() Gets the escaped content tags used for the compiler. | |
array | getTags(bool $escaped = false) Gets the tags used for the compiler. | |
void | setEchoFormat(string $format) Set the echo format to be used by the compiler. |
Details
void __construct(Filesystem $files, string $cachePath)
Create a new compiler instance.
string getCompiledPath(string $path)
Get the path to the compiled version of a view.
bool isExpired(string $path)
Determine if the view at the given path is expired.
void compile(string $path = null)
Compile the view at the given path.
string getPath()
Get the path currently being compiled.
void setPath(string $path)
Set the path currently being compiled.
string compileString(string $value)
Compile the given Blade template contents.
protected string storeVerbatimBlocks(string $value)
Store the verbatim blocks and replace them with a temporary placeholder.
protected string restoreVerbatimBlocks(string $result)
Replace the raw placeholders with the original code stored in the raw blocks.
protected string parseToken(array $token)
Parse the tokens from the template.
protected string compileExtensions(string $value)
Execute the user defined extensions.
protected string compileComments(string $value)
Compile Blade comments into valid PHP.
protected string compileEchos(string $value)
Compile Blade echos into valid PHP.
protected array getEchoMethods()
Get the echo methods in the proper order for compilation.
protected mixed compileStatements(string $value)
Compile Blade statements that start with "@".
protected string compileRawEchos(string $value)
Compile the "raw" echo statements.
protected string compileRegularEchos(string $value)
Compile the "regular" echo statements.
protected string compileEscapedEchos(string $value)
Compile the escaped echo statements.
string compileEchoDefaults(string $value)
Compile the default values for the echo statement.
protected string compileEach(string $expression)
Compile the each statements into valid PHP.
protected string compileInject(string $expression)
Compile the inject statements into valid PHP.
protected string compileYield(string $expression)
Compile the yield statements into valid PHP.
protected string compileShow(string $expression)
Compile the show statements into valid PHP.
protected string compileSection(string $expression)
Compile the section statements into valid PHP.
protected string compileAppend(string $expression)
Compile the append statements into valid PHP.
protected string compileEndsection(string $expression)
Compile the end-section statements into valid PHP.
protected string compileStop(string $expression)
Compile the stop statements into valid PHP.
protected string compileOverwrite(string $expression)
Compile the overwrite statements into valid PHP.
protected string compileUnless(string $expression)
Compile the unless statements into valid PHP.
protected string compileEndunless(string $expression)
Compile the end unless statements into valid PHP.
protected string compileLang(string $expression)
Compile the lang statements into valid PHP.
protected string compileChoice(string $expression)
Compile the choice statements into valid PHP.
protected string compileElse(string $expression)
Compile the else statements into valid PHP.
protected string compileFor(string $expression)
Compile the for statements into valid PHP.
protected string compileForeach(string $expression)
Compile the foreach statements into valid PHP.
protected string compileBreak(string $expression)
Compile the break statements into valid PHP.
protected string compileContinue(string $expression)
Compile the continue statements into valid PHP.
protected string compileForelse(string $expression)
Compile the forelse statements into valid PHP.
protected string compileCan(string $expression)
Compile the can statements into valid PHP.
protected string compileElsecan(string $expression)
Compile the else-can statements into valid PHP.
protected string compileCannot(string $expression)
Compile the cannot statements into valid PHP.
protected string compileElsecannot(string $expression)
Compile the else-can statements into valid PHP.
protected string compileIf(string $expression)
Compile the if statements into valid PHP.
protected string compileElseif(string $expression)
Compile the else-if statements into valid PHP.
protected string compileEmpty(string $expression)
Compile the forelse statements into valid PHP.
protected string compileHasSection(string $expression)
Compile the has section statements into valid PHP.
protected string compileWhile(string $expression)
Compile the while statements into valid PHP.
protected string compileEndwhile(string $expression)
Compile the end-while statements into valid PHP.
protected string compileEndfor(string $expression)
Compile the end-for statements into valid PHP.
protected string compileEndforeach(string $expression)
Compile the end-for-each statements into valid PHP.
protected string compileEndcan(string $expression)
Compile the end-can statements into valid PHP.
protected string compileEndcannot(string $expression)
Compile the end-cannot statements into valid PHP.
protected string compileEndif(string $expression)
Compile the end-if statements into valid PHP.
protected string compileEndforelse(string $expression)
Compile the end-for-else statements into valid PHP.
protected string compilePhp(string $expression)
Compile the raw PHP statements into valid PHP.
protected string compileEndphp(string $expression)
Compile end-php statement into valid PHP.
protected string compileUnset(string $expression)
Compile the unset statements into valid PHP.
protected string compileExtends(string $expression)
Compile the extends statements into valid PHP.
protected string compileInclude(string $expression)
Compile the include statements into valid PHP.
protected string compileIncludeIf(string $expression)
Compile the include statements into valid PHP.
protected string compileStack(string $expression)
Compile the stack statements into the content.
protected string compilePush(string $expression)
Compile the push statements into valid PHP.
protected string compileEndpush(string $expression)
Compile the endpush statements into valid PHP.
string stripParentheses(string $expression)
Strip the parentheses from the given expression.
array getExtensions()
Get the extensions used by the compiler.
void extend(callable $compiler)
Register a custom Blade compiler.
protected string callCustomDirective(string $name, string|null $value)
Call the given directive with the given value.
void directive(string $name, callable $handler)
Register a handler for custom directives.
array getCustomDirectives()
Get the list of custom directives.
array getRawTags()
Gets the raw tags used by the compiler.
void setRawTags(string $openTag, string $closeTag)
Sets the raw tags used for the compiler.
void setContentTags(string $openTag, string $closeTag, bool $escaped = false)
Sets the content tags used for the compiler.
void setEscapedContentTags(string $openTag, string $closeTag)
Sets the escaped content tags used for the compiler.
string getContentTags()
Gets the content tags used for the compiler.
string getEscapedContentTags()
Gets the escaped content tags used for the compiler.
protected array getTags(bool $escaped = false)
Gets the tags used for the compiler.
void setEchoFormat(string $format)
Set the echo format to be used by the compiler.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.3/Illuminate/View/Compilers/BladeCompiler.html