From 5f1984421af096ef21b7d2011949a233849d4ee3 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 1 Dec 2017 08:10:41 -0600 Subject: [PATCH] add csrf and method blade directives --- .../View/Compilers/BladeCompiler.php | 1 + .../Concerns/CompilesFormHelpers.php | 27 +++++++++++++++++++ tests/View/Blade/BladeFormHelpersTest.php | 12 +++++++++ 3 files changed, 40 insertions(+) create mode 100644 src/Illuminate/View/Compilers/Concerns/CompilesFormHelpers.php create mode 100644 tests/View/Blade/BladeFormHelpersTest.php diff --git a/src/Illuminate/View/Compilers/BladeCompiler.php b/src/Illuminate/View/Compilers/BladeCompiler.php index 538b3fe819e1..5ed1ecaeb61e 100644 --- a/src/Illuminate/View/Compilers/BladeCompiler.php +++ b/src/Illuminate/View/Compilers/BladeCompiler.php @@ -12,6 +12,7 @@ class BladeCompiler extends Compiler implements CompilerInterface Concerns\CompilesComponents, Concerns\CompilesConditionals, Concerns\CompilesEchos, + Concerns\CompilesFormHelpers, Concerns\CompilesIncludes, Concerns\CompilesInjections, Concerns\CompilesJson, diff --git a/src/Illuminate/View/Compilers/Concerns/CompilesFormHelpers.php b/src/Illuminate/View/Compilers/Concerns/CompilesFormHelpers.php new file mode 100644 index 000000000000..50c3b1bb0349 --- /dev/null +++ b/src/Illuminate/View/Compilers/Concerns/CompilesFormHelpers.php @@ -0,0 +1,27 @@ +'; + } + + /* + * Compile the method statements into valid PHP. + * + * @param string $method + * @return string + */ + protected function compileMethod($method) + { + return ""; + } +} diff --git a/tests/View/Blade/BladeFormHelpersTest.php b/tests/View/Blade/BladeFormHelpersTest.php new file mode 100644 index 000000000000..bddd7ab4c3c8 --- /dev/null +++ b/tests/View/Blade/BladeFormHelpersTest.php @@ -0,0 +1,12 @@ +assertEquals('', $this->compiler->compileString('@csrf')); + $this->assertEquals('', $this->compiler->compileString("@method('patch')")); + } +}