Skip to content

Commit 3459991

Browse files
committed
nette/application 3.2.7
1 parent 1891216 commit 3459991

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

application/cs/creating-links.texy

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ Odkazy generované pomocí `link()` nebo `n:href` jsou vždy absolutní cesty (t
130130

131131
Pro vygenerování absolutní URL přidejte na začátek dvě lomítka (např. `n:href="//Home:"`). Nebo lze přepnout presenter, aby generoval jen absolutní odkazy nastavením `$this->absoluteUrls = true`.
132132

133+
V šabloně lze také použít filtr `|absoluteUrl`, který relativní cestu převede na absolutní.
134+
133135

134136
Odkaz na aktuální stránku
135137
=========================
@@ -179,6 +181,21 @@ Pro zjištění, zda jsme v určitém modulu nebo jeho submodulu, použijeme met
179181
```
180182

181183

184+
Změna základu pro odkazy .{data-version:v3.2.7}
185+
========================
186+
187+
Ve výchozím stavu se relativní odkazy odvíjejí od aktuálního presenteru. To lze změnit pomocí `{linkBase}`:
188+
189+
```latte
190+
{linkBase Admin:Dashboard}
191+
<a n:href="Product:show">detail produktu</a>
192+
```
193+
194+
Odkaz povede na `Admin:Dashboard:Product:show`. Ovlivněny jsou pouze relativní odkazy - absolutní odkazy začínající dvojtečkou a odkazy na aktuální presenter (`this`, `show`) zůstávají nezměněny.
195+
196+
`{linkBase}` platí pro celou šablonu a je užitečné zejména v šablonách layoutu, kde zajistí konzistentní odkazy nezávisle na volajícím presenteru.
197+
198+
182199
Odkazy na signál
183200
================
184201

application/en/creating-links.texy

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ Links generated using `link()` or `n:href` are always absolute paths (i.e., they
130130

131131
To generate an absolute URL, add two slashes at the beginning (e.g., `n:href="//Home:"`). Alternatively, you can switch the presenter to generate only absolute links by setting `$this->absoluteUrls = true`.
132132

133+
The `|absoluteUrl` filter can also be used in the template to convert a relative path to an absolute path.
134+
133135

134136
Link to Current Page
135137
====================
@@ -179,6 +181,21 @@ To determine if we are in a specific module or its submodule, use the `isModuleC
179181
```
180182

181183

184+
Changing Link Base .{data-version:v3.2.7}
185+
===================
186+
187+
By default, relative links are derived from the current presenter. This can be changed using `{linkBase}`:
188+
189+
```latte
190+
{linkBase Admin:Dashboard}
191+
<a n:href="Product:show">product detail</a>
192+
```
193+
194+
The link will lead to `Admin:Dashboard:Product:show`. Only relative links are affected - absolute links starting with a colon and links to the current presenter (`this`, `show`) remain unchanged.
195+
196+
`{linkBase}` applies to the entire template and is especially useful in layout templates, where it ensures consistent links regardless of the calling presenter.
197+
198+
182199
Links to Signal
183200
===============
184201

latte/cs/tags.texy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ Přehled a popis všech tagů (neboli značek či maker) šablonovacího systém
9797
| `n:href` | [odkaz používaný v HTML elementech `<a>` |application:creating-links#V šabloně presenteru]
9898
| `{link}` | [vypíše odkaz |application:creating-links#V šabloně presenteru]
9999
| `{plink}` | [vypíše odkaz na presenter |application:creating-links#V šabloně presenteru]
100+
| `{linkBase}` | [změna základu odkazu |application:creating-links#změna základu odkazu]
100101
| `{control}` | [vykreslí komponentu |application:components#Vykreslení]
101102
| `{snippet}` … `{/snippet}` | [výstřižek, který lze odeslat AJAXem |application:ajax#Snippety v Latte]
102103
| `{snippetArea}` | [obálka pro výstřižky |application:ajax#Oblasti snippetů]

latte/en/tags.texy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ An overview and description of all the tags available by default in the Latte te
9797
| `n:href` | [link used in `<a>` HTML elements |application:creating-links#In the Presenter Template]
9898
| `{link}` | [prints a link |application:creating-links#In the Presenter Template]
9999
| `{plink}` | [prints a link to a presenter |application:creating-links#In the Presenter Template]
100+
| `{linkBase}` | [changing link base |application:creating-links#Changing Link Base]
100101
| `{control}` | [renders a component |application:components#Rendering]
101102
| `{snippet}` … `{/snippet}` | [a template snippet that can be sent via AJAX |application:ajax#Snippets in Latte]
102103
| `{snippetArea}` | [snippet wrapper |application:ajax#Snippet Areas]

0 commit comments

Comments
 (0)