Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\View\Compilers\Concerns;
4
 
5
trait CompilesErrors
6
{
7
    /**
8
     * Compile the error statements into valid PHP.
9
     *
10
     * @param  string  $expression
11
     * @return string
12
     */
13
    protected function compileError($expression)
14
    {
15
        $expression = $this->stripParentheses($expression);
16
 
17
        return '<?php $__errorArgs = ['.$expression.'];
18
$__bag = $errors->getBag($__errorArgs[1] ?? \'default\');
19
if ($__bag->has($__errorArgs[0])) :
20
if (isset($message)) { $__messageOriginal = $message; }
21
$message = $__bag->first($__errorArgs[0]); ?>';
22
    }
23
 
24
    /**
25
     * Compile the enderror statements into valid PHP.
26
     *
27
     * @param  string  $expression
28
     * @return string
29
     */
30
    protected function compileEnderror($expression)
31
    {
32
        return '<?php unset($message);
33
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
34
endif;
35
unset($__errorArgs, $__bag); ?>';
36
    }
37
}