|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Copyright (c) 2018 Justin Kuenzel (jukusoft.com) |
|
4
|
|
|
* |
|
5
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
6
|
|
|
* you may not use this file except in compliance with the License. |
|
7
|
|
|
* You may obtain a copy of the License at |
|
8
|
|
|
* |
|
9
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
|
10
|
|
|
* |
|
11
|
|
|
* Unless required by applicable law or agreed to in writing, software |
|
12
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
|
13
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
14
|
|
|
* See the License for the specific language governing permissions and |
|
15
|
|
|
* limitations under the License. |
|
16
|
|
|
*/ |
|
17
|
|
|
|
|
18
|
|
|
namespace Dwoo\Plugins\Functions; |
|
19
|
|
|
|
|
20
|
|
|
use Dwoo\Compiler; |
|
21
|
|
|
use Dwoo\Block\Plugin as Plugin; |
|
22
|
|
|
use Dwoo\ICompilable\Block as ICompilableBlock; |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* Copyright (c) 2018 Justin Kuenzel (jukusoft.com) |
|
26
|
|
|
* |
|
27
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
28
|
|
|
* you may not use this file except in compliance with the License. |
|
29
|
|
|
* You may obtain a copy of the License at |
|
30
|
|
|
* |
|
31
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
|
32
|
|
|
* |
|
33
|
|
|
* Unless required by applicable law or agreed to in writing, software |
|
34
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
|
35
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
36
|
|
|
* See the License for the specific language governing permissions and |
|
37
|
|
|
* limitations under the License. |
|
38
|
|
|
*/ |
|
39
|
|
|
|
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* Project: JuKuCMS |
|
43
|
|
|
* License: Apache 2.0 license |
|
44
|
|
|
* User: Justin |
|
45
|
|
|
* Date: 07.04.2018 |
|
46
|
|
|
* Time: 12:56 |
|
47
|
|
|
*/ |
|
48
|
|
|
|
|
49
|
|
|
class PluginLang extends Plugin/* implements ICompilableBlock*/ { |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* @param Compiler $compiler |
|
53
|
|
|
* @param mixed $value |
|
54
|
|
|
* @param mixed $var |
|
55
|
|
|
* |
|
56
|
|
|
* @return string |
|
57
|
|
|
*/ |
|
58
|
|
|
/*public static function compile(Compiler $compiler, $value, $domain = "") { |
|
59
|
|
|
return 'Translator::translate(' . $value . ', ' . $domain . ')'; |
|
60
|
|
|
}*/ |
|
61
|
|
|
|
|
62
|
|
|
// parameters go here if you need any settings |
|
63
|
|
|
public function init() { |
|
64
|
|
|
// |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
// this can be ommitted, it's called once when the block ends, don't implement if you don't need it |
|
68
|
|
|
public function end() { |
|
69
|
|
|
// |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
// this is called when the block is required to output it's data, it should read $this->buffer, process it and return it |
|
73
|
|
|
public function process(){ |
|
74
|
|
|
var_dump($this->buffer); |
|
|
|
|
|
|
75
|
|
|
|
|
76
|
|
|
exit; |
|
|
|
|
|
|
77
|
|
|
return strtoupper($this->buffer); |
|
|
|
|
|
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
?> |
|
|
|
|
|
|
83
|
|
|
|