Vous êtes connecté en tant que anonymous Se Deconnecter
Browse code

Application modulaire fonctionnelle !

Emmanuel ROY authored on 12/08/2019 15:10:25
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,34 +0,0 @@
1
-<?php
2
-
3
-namespace Illuminate\Support\Traits;
4
-
5
-use Illuminate\Container\Container;
6
-
7
-trait Localizable
8
-{
9
-    /**
10
-     * Run the callback with the given locale.
11
-     *
12
-     * @param  string   $locale
13
-     * @param  \Closure $callback
14
-     * @return mixed
15
-     */
16
-    public function withLocale($locale, $callback)
17
-    {
18
-        if (! $locale) {
19
-            return $callback();
20
-        }
21
-
22
-        $app = Container::getInstance();
23
-
24
-        $original = $app->getLocale();
25
-
26
-        try {
27
-            $app->setLocale($locale);
28
-
29
-            return $callback();
30
-        } finally {
31
-            $app->setLocale($original);
32
-        }
33
-    }
34
-}
Browse code

initial commit

Emmanuel ROY authored on 09/08/2019 08:39:02
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,34 @@
1
+<?php
2
+
3
+namespace Illuminate\Support\Traits;
4
+
5
+use Illuminate\Container\Container;
6
+
7
+trait Localizable
8
+{
9
+    /**
10
+     * Run the callback with the given locale.
11
+     *
12
+     * @param  string   $locale
13
+     * @param  \Closure $callback
14
+     * @return mixed
15
+     */
16
+    public function withLocale($locale, $callback)
17
+    {
18
+        if (! $locale) {
19
+            return $callback();
20
+        }
21
+
22
+        $app = Container::getInstance();
23
+
24
+        $original = $app->getLocale();
25
+
26
+        try {
27
+            $app->setLocale($locale);
28
+
29
+            return $callback();
30
+        } finally {
31
+            $app->setLocale($original);
32
+        }
33
+    }
34
+}