File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
src/Bridges/ApplicationLatte Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,15 @@ public function getParameters()
198198 }
199199
200200
201+ /**
202+ * @deprecated
203+ */
204+ public function __call ($ name , $ args )
205+ {
206+ return $ this ->latte ->invokeFilter ($ name , $ args );
207+ }
208+
209+
201210 /**
202211 * Sets a template parameter. Do not call directly.
203212 * @return void
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /**
4+ * Test: Template filters
5+ */
6+
7+ use Nette \Bridges \ApplicationLatte \Template ,
8+ Tester \Assert ;
9+
10+
11+ require __DIR__ . '/../bootstrap.php ' ;
12+
13+ $ engine = new Latte \Engine ;
14+ $ template = new Template ($ engine );
15+
16+ Assert::exception (function () use ($ template ) {
17+ $ template ->length ('abc ' );
18+ }, 'LogicException ' , "Filter 'length' is not defined. " );
19+
20+ $ engine ->addFilter ('length ' , 'strlen ' );
21+
22+ Assert::same ( 3 , $ template ->length ('abc ' ) );
You can’t perform that action at this time.
0 commit comments