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\Concerns;
4
 
5
trait ManagesTranslations
6
{
7
    /**
8
     * The translation replacements for the translation being rendered.
9
     *
10
     * @var array
11
     */
12
    protected $translationReplacements = [];
13
 
14
    /**
15
     * Start a translation block.
16
     *
17
     * @param  array  $replacements
18
     * @return void
19
     */
20
    public function startTranslation($replacements = [])
21
    {
22
        ob_start();
23
 
24
        $this->translationReplacements = $replacements;
25
    }
26
 
27
    /**
28
     * Render the current translation.
29
     *
30
     * @return string
31
     */
32
    public function renderTranslation()
33
    {
34
        return $this->container->make('translator')->get(
35
            trim(ob_get_clean()), $this->translationReplacements
36
        );
37
    }
38
}