You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: latte/en/cookbook/migration-from-latte2.texy
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ API Changes
22
22
23
23
The API changes only apply to adding custom tags. The rest of the API remains the same as version 2, i.e. the same way to render templates, pass parameters, register filters.
24
24
25
-
The exception is the replacement of the so-called dynamic filter `Engine::addFilter(null, ...)` with [filter loader |/extending-latte#Filter Loader], which differs in that it always returns callable and is registered with the `Engine::addFilterLoader()` method.
25
+
The exception is the replacement of the so-called dynamic filter `Engine::addFilter(null, ...)` with [filter loader |/custom-filters#Filter Loader], which differs in that it always returns callable and is registered with the `Engine::addFilterLoader()` method.
26
26
27
27
The API for adding custom tags is completely different, so add-ons designed for Latte 2 won't work with it. See also [#Updates to add-ons].
28
28
@@ -53,7 +53,7 @@ And more edge cases:
53
53
Updates to Add-Ons
54
54
==================
55
55
56
-
With the complete rewrite of the parser, the way to write custom tags has completely changed. If you have custom tags created for Latte, you will need to re-write them for version 3, see [documentation|/creating-extension].
56
+
With the complete rewrite of the parser, the way to write custom tags has completely changed. If you have custom tags created for Latte, you will need to re-write them for version 3, see [documentation|/custom-tags].
57
57
58
58
If you are using a foreign add-on that adds tags, you will need to wait until the author releases a version for Latte 3. The `nette/application`, `nette/caching` and `nette/forms` libraries in version 3.1, as well as Texy, have already been updated and work with both Latte 2 and 3.
59
59
@@ -208,7 +208,7 @@ $this->latte->onCompile[] = function (Latte\Engine $latte) {
208
208
};
209
209
```
210
210
211
-
Latte 3 is extended using [extensions|/creating-extension]. A trivial extension adding the `foo` tag would look like this:
211
+
Latte 3 is extended using [extensions|/extending-latte]. A trivial extension adding the `foo` tag would look like this:
212
212
213
213
```php
214
214
// new code for Latte 3
@@ -254,7 +254,7 @@ class FooNode extends Latte\Compiler\Nodes\StatementNode
254
254
}
255
255
```
256
256
257
-
Furthermore, the mask in `$context->format()` no longer has `%node.***` abbreviations, it is assumed that you [parse the tag content |/creating-extension#Tag Parsing Function] first. So we use the parser to parse the content into variables (subnodes), and then we write it out:
257
+
Furthermore, the mask in `$context->format()` no longer has `%node.***` abbreviations, it is assumed that you [parse the tag content |/custom-tags#Tag Parsing Function] first. So we use the parser to parse the content into variables (subnodes), and then we write it out:
258
258
259
259
```php
260
260
use Latte\Compiler\Nodes\Php\Expression\ArrayNode;
@@ -286,7 +286,7 @@ class FooNode extends Latte\Compiler\Nodes\StatementNode
286
286
}
287
287
```
288
288
289
-
Finally, we will add the `getIterator()` method to allow subnodes to be traversed when [traversing |/creating-extension#Node Traverser]:
289
+
Finally, we will add the `getIterator()` method to allow subnodes to be traversed when [traversing |/custom-tags#Node Traverser]:
290
290
291
291
```php
292
292
class FooNode extends Latte\Compiler\Nodes\StatementNode
0 commit comments