aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilly Micieli <micieli@laposte.net>2019-10-26 21:31:34 +0200
committerWilly Micieli <micieli@laposte.net>2019-10-26 21:31:34 +0200
commit1df1759851a8d42811744384e1a5911c38552fc1 (patch)
tree1aa73698594f5b97dc3bc184d153e297ea5e506d
parentc8f9bbce2b82718df364f14078ea4e254b5c9a6e (diff)
downloadshaolin-1df1759851a8d42811744384e1a5911c38552fc1.zip
shaolin-1df1759851a8d42811744384e1a5911c38552fc1.tar.gz
add twig extension dir
-rw-r--r--app/Twig/Filters/ViewsFilters.php17
-rw-r--r--app/Twig/Functions/ViewsFunctions.php17
-rw-r--r--app/Twig/Globals/ViewsGlobals.php16
-rw-r--r--app/Twig/Tests/ViewsTests.php17
-rw-r--r--composer.json2
-rw-r--r--twig/functions/functions.php13
6 files changed, 81 insertions, 1 deletions
diff --git a/app/Twig/Filters/ViewsFilters.php b/app/Twig/Filters/ViewsFilters.php
new file mode 100644
index 0000000..11dfceb
--- /dev/null
+++ b/app/Twig/Filters/ViewsFilters.php
@@ -0,0 +1,17 @@
+<?php
+
+ namespace App\Twig\Filters;
+ use Twig\Extension\AbstractExtension;
+ use Twig\TwigFilter;
+
+ class ViewsFilters extends AbstractExtension
+ {
+
+ public function getFilters()
+ {
+ return [
+ new TwigFilter('', '',['is_safe'=>'html'])
+ ];
+
+ }
+ } \ No newline at end of file
diff --git a/app/Twig/Functions/ViewsFunctions.php b/app/Twig/Functions/ViewsFunctions.php
new file mode 100644
index 0000000..e61d779
--- /dev/null
+++ b/app/Twig/Functions/ViewsFunctions.php
@@ -0,0 +1,17 @@
+<?php
+
+ namespace App\Twig\Functions;
+ use Twig\Extension\AbstractExtension;
+ use Twig\TwigFunction;
+
+ class ViewsFunctions extends AbstractExtension
+ {
+
+ public function getFunctions()
+ {
+ return [
+ new TwigFunction('', '',['is_safe'=>'html'])
+ ];
+
+ }
+ } \ No newline at end of file
diff --git a/app/Twig/Globals/ViewsGlobals.php b/app/Twig/Globals/ViewsGlobals.php
new file mode 100644
index 0000000..2e4a567
--- /dev/null
+++ b/app/Twig/Globals/ViewsGlobals.php
@@ -0,0 +1,16 @@
+<?php
+
+ namespace App\Twig\Globals;
+ use Twig\Extension\AbstractExtension;
+
+ class ViewsGlobals extends AbstractExtension
+ {
+
+ public function getGlobals()
+ {
+ return [
+ '' => ''
+ ];
+
+ }
+ } \ No newline at end of file
diff --git a/app/Twig/Tests/ViewsTests.php b/app/Twig/Tests/ViewsTests.php
new file mode 100644
index 0000000..d9eb99a
--- /dev/null
+++ b/app/Twig/Tests/ViewsTests.php
@@ -0,0 +1,17 @@
+<?php
+
+ namespace App\Twig\Tests;
+ use Twig\Extension\AbstractExtension;
+ use Twig\TwigTest;
+
+ class ViewsTests extends AbstractExtension
+ {
+
+ public function getTests()
+ {
+ return [
+ new TwigTest('', '')
+ ];
+
+ }
+ } \ No newline at end of file
diff --git a/composer.json b/composer.json
index 5c97e52..b7b4ef4 100644
--- a/composer.json
+++ b/composer.json
@@ -10,7 +10,7 @@
}
],
"require": {
- "imperium/imperium": "^10.5"
+ "imperium/imperium": "^10.5.3"
},
"autoload": {
"psr-4": {
diff --git a/twig/functions/functions.php b/twig/functions/functions.php
new file mode 100644
index 0000000..fe056a5
--- /dev/null
+++ b/twig/functions/functions.php
@@ -0,0 +1,13 @@
+<?php
+
+class functions extends \Twig\Extension\AbstractExtension
+{
+ public function getFunctions()
+ {
+ return [
+ new \Twig\TwigFunction('a', 'a'),
+ ];
+ }
+
+
+} \ No newline at end of file