Skip to content

Commit 87e823b

Browse files
mildabredg
authored andcommitted
application: improvements (#999)(#1002)
1 parent 16c6b92 commit 87e823b

32 files changed

+80
-48
lines changed

application/bg/presenters.texy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ $url = $this->link('Product:show', [$id, 'lang' => 'en']);
158158
$this->forward('Product:show');
159159
```
160160

161-
Пример за временно пренасочване с HTTP код 302 или 303:
161+
Пример за т.нар. временно пренасочване с HTTP код 302 (или 303, ако текущият метод на заявка е POST):
162162

163163
```php
164164
$this->redirect('Product:show', $id);
@@ -170,7 +170,7 @@ $this->redirect('Product:show', $id);
170170
$this->redirectPermanent('Product:show', $id);
171171
```
172172

173-
Можете да пренасочите към друг URL адрес извън приложението, като използвате метода `redirectUrl()`:
173+
Можете да пренасочите към друг URL адрес извън приложението, като използвате метода `redirectUrl()`. Като втори параметър може да се посочи HTTP кодът, като по подразбиране той е 302 (или 303, ако текущият метод на заявка е POST):
174174

175175
```php
176176
$this->redirectUrl('https://nette.org');

application/bg/templates.texy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ Nette използва системата за шаблони [Latte |latte:]. L
4242
- `templates/<Presenter>/<view>.latte`
4343
- `templates/<Presenter>.<view>.latte`
4444

45-
Ако шаблонът не е намерен, отговорът ще бъде [грешка 404 |presenters#error-404-etc].
45+
Ако шаблонът не бъде намерен, ще се опита да търси в директорията `templates` едно ниво по-нагоре, т.е. на същото ниво като директорията с класа на водещия.
46+
47+
Ако шаблонът не бъде намерен и там, отговорът ще бъде [грешка 404 |presenters#Error 404 etc.].
4648

4749
Можете също така да промените изгледа с помощта на `$this->setView('jineView')`. Или вместо да търсите директно, посочете името на файла с шаблона, като използвате `$this->template->setFile('/path/to/template.latte')`.
4850

application/cs/presenters.texy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Metoda `forward()` přejde na nový presenter okamžitě bez HTTP přesměrován
158158
$this->forward('Product:show');
159159
```
160160

161-
Příklad tzv. dočasného přesměrování s HTTP kódem 302 nebo 303:
161+
Příklad tzv. dočasného přesměrování s HTTP kódem 302 (nebo 303, je-li metoda aktuálního požadavku POST):
162162

163163
```php
164164
$this->redirect('Product:show', $id);
@@ -170,7 +170,7 @@ Permanentní přesměrování s HTTP kódem 301 docílíte takto:
170170
$this->redirectPermanent('Product:show', $id);
171171
```
172172

173-
Na jinou URL mimo aplikaci lze přesměrovat metodou `redirectUrl()`:
173+
Na jinou URL mimo aplikaci lze přesměrovat metodou `redirectUrl()`. Jako druhý parametr lze uvést HTTP kód, výchozí je 302 (nebo 303, je-li metoda aktuálního požadavku POST):
174174

175175
```php
176176
$this->redirectUrl('https://nette.org');

application/cs/templates.texy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ Cestu k šablonám odvodí presenter podle jednoduché logiky. Zkusí, zda exist
4242
- `templates/<Presenter>/<view>.latte`
4343
- `templates/<Presenter>.<view>.latte`
4444

45-
Pokud šablonu nenajde, je odpovědí [chyba 404|presenters#Chyba 404 a spol.].
45+
Pokud šablonu nenajde, zkusí hledat ještě v adresáři `templates` o úroveň výš, tj. na stejné úrovni, jako je adresář s třídou presenteru.
46+
47+
Pokud ani tam šablonu nenajde, je odpovědí [chyba 404|presenters#Chyba 404 a spol.].
4648

4749
Můžete také změnit view pomocí `$this->setView('jineView')`. Nebo místo dohledávání přímo určit jméno souboru se šablonou pomocí `$this->template->setFile('/path/to/template.latte')`.
4850

application/de/presenters.texy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Die `forward()` schaltet ohne HTTP-Umleitung sofort auf den neuen Präsentator u
158158
$this->forward('Product:show');
159159
```
160160

161-
Beispiel einer temporären Umleitung mit HTTP-Code 302 oder 303:
161+
Beispiel für eine so genannte temporäre Umleitung mit HTTP-Code 302 (oder 303, wenn die aktuelle Anfragemethode POST ist):
162162

163163
```php
164164
$this->redirect('Product:show', $id);
@@ -170,7 +170,7 @@ Um eine dauerhafte Umleitung mit HTTP-Code 301 zu erreichen, verwenden Sie:
170170
$this->redirectPermanent('Product:show', $id);
171171
```
172172

173-
Sie können mit der Methode `redirectUrl()` zu einer anderen URL außerhalb der Anwendung umleiten:
173+
Sie können mit der Methode `redirectUrl()` zu einer anderen URL außerhalb der Anwendung umleiten. Der HTTP-Code kann als zweiter Parameter angegeben werden, wobei der Standardwert 302 ist (oder 303, wenn die aktuelle Anforderungsmethode POST ist):
174174

175175
```php
176176
$this->redirectUrl('https://nette.org');

application/de/templates.texy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ Der Pfad zu den Vorlagen wird nach einer einfachen Logik hergeleitet. Es wird ve
4242
- `templates/<Presenter>/<view>.latte`
4343
- `templates/<Presenter>.<view>.latte`
4444

45-
Wenn die Vorlage nicht gefunden wird, wird der [Fehler 404 |presenters#Error 404 etc.] ausgegeben.
45+
Wird die Vorlage nicht gefunden, wird versucht, im Verzeichnis `templates` eine Ebene höher zu suchen, d. h. auf der gleichen Ebene wie das Verzeichnis mit der Presenter-Klasse.
46+
47+
Wenn die Vorlage auch dort nicht gefunden wird, ist die Antwort ein [404-Fehler |presenters#Error 404 etc.].
4648

4749
Sie können die Ansicht auch mit `$this->setView('otherView')` ändern. Oder geben Sie statt der Suche direkt den Namen der Vorlagendatei mit `$this->template->setFile('/path/to/template.latte')` an.
4850

application/el/presenters.texy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ $url = $this->link('Product:show', [$id, 'lang' => 'en']);
158158
$this->forward('Product:show');
159159
```
160160

161-
με κωδικό HTTP 302 ή 303:
161+
Παράδειγμα μιας λεγόμενης προσωρινής ανακατεύθυνσης με κωδικό HTTP 302 (ή 303, εάν η τρέχουσα μέθοδος αίτησης είναι POST):
162162

163163
```php
164164
$this->redirect('Product:show', $id);
@@ -170,7 +170,7 @@ $this->redirect('Product:show', $id);
170170
$this->redirectPermanent('Product:show', $id);
171171
```
172172

173-
Μπορείτε να ανακατευθύνετε σε μια άλλη διεύθυνση URL εκτός της εφαρμογής με τη μέθοδο `redirectUrl()`:
173+
Μπορείτε να ανακατευθύνετε σε μια άλλη διεύθυνση URL εκτός της εφαρμογής χρησιμοποιώντας τη μέθοδο `redirectUrl()`. Ο κωδικός HTTP μπορεί να καθοριστεί ως δεύτερη παράμετρος, με προεπιλεγμένη τιμή 302 (ή 303, αν η τρέχουσα μέθοδος αίτησης είναι POST):
174174

175175
```php
176176
$this->redirectUrl('https://nette.org');

application/el/templates.texy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@
4242
- `templates/<Presenter>/<view>.latte`
4343
- `templates/<Presenter>.<view>.latte`
4444

45-
Αν δεν βρει το πρότυπο, η απάντηση είναι [σφάλμα 404 |presenters#Error 404 etc.].
45+
Αν το πρότυπο δεν βρεθεί, θα προσπαθήσει να ψάξει στον κατάλογο `templates` ένα επίπεδο πιο πάνω, δηλαδή στο ίδιο επίπεδο με τον κατάλογο με την κλάση παρουσιαστή.
46+
47+
Εάν το πρότυπο δεν βρεθεί ούτε εκεί, η απάντηση είναι ένα [σφάλμα 404 |presenters#Error 404 etc.].
4648

4749
Μπορείτε επίσης να αλλάξετε την προβολή χρησιμοποιώντας το `$this->setView('otherView')`. Ή, αντί για αναζήτηση, καθορίστε απευθείας το όνομα του αρχείου προτύπου χρησιμοποιώντας τη διεύθυνση `$this->template->setFile('/path/to/template.latte')`.
4850

application/en/presenters.texy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ The `forward()` switches to the new presenter immediately without HTTP redirecti
158158
$this->forward('Product:show');
159159
```
160160

161-
Example of temporary redirection with HTTP code 302 or 303:
161+
Example of a so-called temporary redirection with HTTP code 302 (or 303, if the current request method is POST):
162162

163163
```php
164164
$this->redirect('Product:show', $id);
@@ -170,7 +170,7 @@ To achieve permanent redirection with HTTP code 301 use:
170170
$this->redirectPermanent('Product:show', $id);
171171
```
172172

173-
You can redirect to another URL outside the application with the `redirectUrl()` method:
173+
You can redirect to another URL outside the application using the `redirectUrl()` method. The HTTP code can be specified as the second parameter, with the default being 302 (or 303, if the current request method is POST):
174174

175175
```php
176176
$this->redirectUrl('https://nette.org');

application/en/templates.texy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ The path to the templates is deduced according to simple logic. It tries to see
4242
- `templates/<Presenter>/<view>.latte`
4343
- `templates/<Presenter>.<view>.latte`
4444

45-
If it does not find the template, the response is [error 404 |presenters#Error 404 etc.].
45+
If the template is not found, it will try to search in the `templates` directory one level up, i.e., at the same level as the directory with the presenter class.
46+
47+
If the template is not found there either, the response is a [404 error|presenters#Error 404 etc.].
4648

4749
You can also change the view using `$this->setView('otherView')`. Or, instead of searching, directly specify the name of the template file using `$this->template->setFile('/path/to/template.latte')`.
4850

0 commit comments

Comments
 (0)