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: application/bg/presenters.texy
+3-3
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ class ArticlePresenter extends Nette\Application\UI\Presenter
60
60
61
61
Важното е, че `action<Action>()` се извиква преди `render<View>()`, така че в него можем евентуално да променим следващия жизнен цикъл, т.е. да променим шаблона за визуализиране и метода `render<View>()`която ще бъде извикана с помощта на `setView('otherView')`.
62
62
63
-
Параметрите от заявката се предават на метода. Възможно и препоръчително е да се посочат типове за параметрите, например `actionShow(int $id, string $slug = null)` - ако параметърът `id` липсва или ако не е цяло число, презентаторът ще върне [грешка 404 |#Error-404-etc] и ще прекрати операцията.
63
+
Параметрите от заявката се предават на метода. Възможно и препоръчително е да се посочат типове за параметрите, например `actionShow(int $id, ?string $slug = null)` - ако параметърът `id` липсва или ако не е цяло число, презентаторът ще върне [грешка 404 |#Error-404-etc] и ще прекрати операцията.
Когато не можем да изпълним дадена заявка, защото например статията, която искаме да покажем, не съществува в базата данни, ще хвърлим грешка 404, като използваме метода `error(string $message = null, int $httpCode = 404)`, който представлява HTTP грешка 404:
208
+
Когато не можем да изпълним дадена заявка, защото например статията, която искаме да покажем, не съществува в базата данни, ще хвърлим грешка 404, като използваме метода `error(?string $message = null, int $httpCode = 404)`, който представлява HTTP грешка 404:
209
209
210
210
```php
211
211
public function renderShow(int $id): void
@@ -384,7 +384,7 @@ class ProductPresenter extends Nette\Application\UI\Presenter
384
384
Можете също така да извикате канонизацията ръчно с метода `canonicalize()`, който, както и методът `link()`, приема като аргументи водещия, действията и параметрите. Тя създава връзка и я сравнява с текущия URL адрес. Ако те са различни, се пренасочва към генерираната връзка.
385
385
386
386
```php
387
-
public function actionShow(int $id, string $slug = null): void
387
+
public function actionShow(int $id, ?string $slug = null): void
Copy file name to clipboardexpand all lines: application/cs/presenters.texy
+3-3
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ Obdoba metody `render<View>()`. Zatímco `render<View>()` je určená k tomu, ab
60
60
61
61
Důležité je, že `action<Action>()` se volá dříve než `render<View>()`, takže v ní můžeme případně změnit další běh dějin, tj. změnit šablonu, která se bude kreslit, a také metodu `render<View>()`, která se bude volat. A to pomocí `setView('jineView')`.
62
62
63
-
Metodě se předávají parametry z požadavku. Je možné a doporučené uvést parametrům typy, např. `actionShow(int $id, string $slug = null)` - pokud bude parametr `id` chybět nebo pokud nebude integer, presenter vrátí [chybu 404|#Chyba 404 a spol.] a ukončí činnost.
63
+
Metodě se předávají parametry z požadavku. Je možné a doporučené uvést parametrům typy, např. `actionShow(int $id, ?string $slug = null)` - pokud bude parametr `id` chybět nebo pokud nebude integer, presenter vrátí [chybu 404|#Chyba 404 a spol.] a ukončí činnost.
@@ -205,7 +205,7 @@ $this->redirect(/* ... */); // a přesměrujeme
205
205
Chyba 404 a spol.
206
206
=================
207
207
208
-
Pokud nelze splnit požadavek, třeba z důvodu, že článek který chceme zobrazit neexistuje v databázi, vyhodíme chybu 404 metodou `error(string $message = null, int $httpCode = 404)`.
208
+
Pokud nelze splnit požadavek, třeba z důvodu, že článek který chceme zobrazit neexistuje v databázi, vyhodíme chybu 404 metodou `error(?string $message = null, int $httpCode = 404)`.
209
209
210
210
```php
211
211
public function renderShow(int $id): void
@@ -384,7 +384,7 @@ K přesměrování nedojde při AJAXovém nebo POST požadavku, protože by doš
384
384
Kanonizaci můžete vyvolat i manuálně pomocí metody `canonicalize()`, které se podobně jako metodě `link()` předá presenter, akce a parametry. Vyrobí odkaz a porovná ho s aktuální URL adresou. Pokud se liší, tak přesměruje na vygenerovaný odkaz.
385
385
386
386
```php
387
-
public function actionShow(int $id, string $slug = null): void
387
+
public function actionShow(int $id, ?string $slug = null): void
Copy file name to clipboardexpand all lines: application/de/presenters.texy
+3-3
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ Unmittelbar nach Erhalt der Anfrage wird die Methode `startup ()` aufgerufen. Si
60
60
61
61
Es ist wichtig, dass `action<Action>()` vor aufgerufen wird `render<View>()`aufgerufen wird, damit wir darin möglicherweise den weiteren Verlauf des Lebenszyklus ändern können, d. h. die Vorlage, die gerendert wird, und auch die Methode `render<View>()` die aufgerufen wird, mit `setView('otherView')`.
62
62
63
-
Die Parameter der Anfrage werden an die Methode übergeben. Es ist möglich und empfehlenswert, Typen für die Parameter anzugeben, z. B. `actionShow(int $id, string $slug = null)` - wenn der Parameter `id` fehlt oder keine ganze Zahl ist, gibt der Präsentator den [Fehler 404 |#Error 404 etc.] zurück und bricht die Operation ab.
63
+
Die Parameter der Anfrage werden an die Methode übergeben. Es ist möglich und empfehlenswert, Typen für die Parameter anzugeben, z. B. `actionShow(int $id, ?string $slug = null)` - wenn der Parameter `id` fehlt oder keine ganze Zahl ist, gibt der Präsentator den [Fehler 404 |#Error 404 etc.] zurück und bricht die Operation ab.
@@ -205,7 +205,7 @@ In der Vorlage sind diese Meldungen in der Variablen `$flashes` als Objekte `std
205
205
Fehler 404 usw. .[#toc-error-404-etc]
206
206
=====================================
207
207
208
-
Wenn wir die Anfrage nicht erfüllen können, weil z.B. der Artikel, den wir anzeigen wollen, nicht in der Datenbank existiert, werden wir den Fehler 404 mit der Methode `error(string $message = null, int $httpCode = 404)` ausgeben, die den HTTP-Fehler 404 darstellt:
208
+
Wenn wir die Anfrage nicht erfüllen können, weil z.B. der Artikel, den wir anzeigen wollen, nicht in der Datenbank existiert, werden wir den Fehler 404 mit der Methode `error(?string $message = null, int $httpCode = 404)` ausgeben, die den HTTP-Fehler 404 darstellt:
209
209
210
210
```php
211
211
public function renderShow(int $id): void
@@ -384,7 +384,7 @@ Eine Umleitung findet bei einer AJAX- oder POST-Anfrage nicht statt, da dies zu
384
384
Sie können die Kanonisierung auch manuell mit der Methode `canonicalize()` aufrufen, die wie die Methode `link()` den Präsentator, Aktionen und Parameter als Argumente erhält. Sie erstellt einen Link und vergleicht ihn mit der aktuellen URL. Wenn sie sich unterscheidet, wird sie auf den erzeugten Link umgeleitet.
385
385
386
386
```php
387
-
public function actionShow(int $id, string $slug = null): void
387
+
public function actionShow(int $id, ?string $slug = null): void
388
388
{
389
389
$realSlug = $this->facade->getSlugForId($id);
390
390
// leitet um, wenn $slug nicht mit $realSlug übereinstimmt
Copy file name to clipboardexpand all lines: application/el/presenters.texy
+3-3
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ class ArticlePresenter extends Nette\Application\UI\Presenter
60
60
61
61
Είναι σημαντικό ότι `action<Action>()` καλείται πριν από την `render<View>()`, ώστε μέσα σε αυτό να μπορούμε ενδεχομένως να αλλάξουμε την επόμενη πορεία του κύκλου ζωής, δηλαδή να αλλάξουμε το πρότυπο που θα αποδοθεί και επίσης τη μέθοδο `render<View>()` που θα κληθεί, χρησιμοποιώντας το `setView('otherView')`.
62
62
63
-
Οι παράμετροι από το αίτημα περνούν στη μέθοδο. Είναι δυνατόν και συνιστάται να καθορίσετε τύπους για τις παραμέτρους, π.χ. `actionShow(int $id, string $slug = null)` - αν η παράμετρος `id` λείπει ή αν δεν είναι ακέραιος αριθμός, ο παρουσιαστής επιστρέφει [σφάλμα 404 |#Error 404 etc.] και τερματίζει τη λειτουργία.
63
+
Οι παράμετροι από το αίτημα περνούν στη μέθοδο. Είναι δυνατόν και συνιστάται να καθορίσετε τύπους για τις παραμέτρους, π.χ. `actionShow(int $id, ?string $slug = null)` - αν η παράμετρος `id` λείπει ή αν δεν είναι ακέραιος αριθμός, ο παρουσιαστής επιστρέφει [σφάλμα 404 |#Error 404 etc.] και τερματίζει τη λειτουργία.
Όταν δεν μπορούμε να ικανοποιήσουμε το αίτημα επειδή για παράδειγμα το άρθρο που θέλουμε να εμφανίσουμε δεν υπάρχει στη βάση δεδομένων, θα πετάξουμε το σφάλμα 404 χρησιμοποιώντας τη μέθοδο `error(string $message = null, int $httpCode = 404)`, η οποία αντιπροσωπεύει το σφάλμα HTTP 404:
208
+
Όταν δεν μπορούμε να ικανοποιήσουμε το αίτημα επειδή για παράδειγμα το άρθρο που θέλουμε να εμφανίσουμε δεν υπάρχει στη βάση δεδομένων, θα πετάξουμε το σφάλμα 404 χρησιμοποιώντας τη μέθοδο `error(?string $message = null, int $httpCode = 404)`, η οποία αντιπροσωπεύει το σφάλμα HTTP 404:
209
209
210
210
```php
211
211
public function renderShow(int $id): void
@@ -384,7 +384,7 @@ class ProductPresenter extends Nette\Application\UI\Presenter
384
384
Μπορείτε επίσης να επικαλεστείτε την κανονικοποίηση χειροκίνητα χρησιμοποιώντας τη μέθοδο `canonicalize()`, η οποία, όπως και η μέθοδος `link()`, λαμβάνει τον παρουσιαστή, τις ενέργειες και τις παραμέτρους ως ορίσματα. Δημιουργεί έναν σύνδεσμο και τον συγκρίνει με την τρέχουσα διεύθυνση URL. Εάν είναι διαφορετική, ανακατευθύνει στον δημιουργημένο σύνδεσμο.
385
385
386
386
```php
387
-
public function actionShow(int $id, string $slug = null): void
387
+
public function actionShow(int $id, ?string $slug = null): void
388
388
{
389
389
$realSlug = $this->facade->getSlugForId($id);
390
390
// ανακατευθύνει εάν το $slug είναι διαφορετικό από το $realSlug
Copy file name to clipboardexpand all lines: application/en/presenters.texy
+3-3
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ Similar to the method `render<View>()`. While `render<View>()` is intended to pr
60
60
61
61
It is important that `action<Action>()` is called before `render<View>()`, so inside it we can possibly change the next course of life cycle, i.e. change the template that will be rendered and also the method `render<View>()` that will be called, using `setView('otherView')`.
62
62
63
-
The parameters from the request are passed to the method. It is possible and recommended to specify types for the parameters, e.g. `actionShow(int $id, string $slug = null)` - if parameter `id` is missing or if it is not an integer, the presenter returns [error 404|#Error 404 etc.] and terminates the operation.
63
+
The parameters from the request are passed to the method. It is possible and recommended to specify types for the parameters, e.g. `actionShow(int $id, ?string $slug = null)` - if parameter `id` is missing or if it is not an integer, the presenter returns [error 404|#Error 404 etc.] and terminates the operation.
@@ -205,7 +205,7 @@ In the template, these messages are available in the variable `$flashes` as obje
205
205
Error 404 etc.
206
206
==============
207
207
208
-
When we can't fulfill the request because for example the article we want to display does not exist in the database, we will throw out the 404 error using method `error(string $message = null, int $httpCode = 404)`, which represents HTTP error 404:
208
+
When we can't fulfill the request because for example the article we want to display does not exist in the database, we will throw out the 404 error using method `error(?string $message = null, int $httpCode = 404)`, which represents HTTP error 404:
209
209
210
210
```php
211
211
public function renderShow(int $id): void
@@ -384,7 +384,7 @@ Redirection does not occur with an AJAX or POST request because it would result
384
384
You can also invoke canonization manually using method `canonicalize()`, which, like method `link()`, receives the presenter, actions, and parameters as arguments. It creates a link and compares it to the current URL. If it is different, it redirects to the generated link.
385
385
386
386
```php
387
-
public function actionShow(int $id, string $slug = null): void
387
+
public function actionShow(int $id, ?string $slug = null): void
Copy file name to clipboardexpand all lines: application/es/presenters.texy
+3-3
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ Similar al método `render<View>()`. Mientras que `render<View>()` está destina
60
60
61
61
Es importante que `action<Action>()` se llame antes que `render<View>()`para que dentro de él podamos posiblemente cambiar el siguiente curso del ciclo de vida, es decir, cambiar la plantilla que será renderizada y también el método `render<View>()` que será llamado, usando `setView('otherView')`.
62
62
63
-
Los parámetros de la petición se pasan al método. Es posible y recomendable especificar tipos para los parámetros, por ejemplo `actionShow(int $id, string $slug = null)` - si el parámetro `id` falta o si no es un entero, el presentador devuelve [el error 404 |#Error 404 etc.] y termina la operación.
63
+
Los parámetros de la petición se pasan al método. Es posible y recomendable especificar tipos para los parámetros, por ejemplo `actionShow(int $id, ?string $slug = null)` - si el parámetro `id` falta o si no es un entero, el presentador devuelve [el error 404 |#Error 404 etc.] y termina la operación.
@@ -205,7 +205,7 @@ En la plantilla, estos mensajes están disponibles en la variable `$flashes` com
205
205
Error 404 etc. .[#toc-error-404-etc]
206
206
====================================
207
207
208
-
Cuando no podamos satisfacer la petición porque por ejemplo el artículo que queremos mostrar no existe en la base de datos, lanzaremos el error 404 utilizando el método `error(string $message = null, int $httpCode = 404)`, que representa el error HTTP 404:
208
+
Cuando no podamos satisfacer la petición porque por ejemplo el artículo que queremos mostrar no existe en la base de datos, lanzaremos el error 404 utilizando el método `error(?string $message = null, int $httpCode = 404)`, que representa el error HTTP 404:
209
209
210
210
```php
211
211
public function renderShow(int $id): void
@@ -384,7 +384,7 @@ La redirección no se produce con una solicitud AJAX o POST porque provocaría u
384
384
También puede invocar la canonización manualmente mediante el método `canonicalize()`, que, al igual que el método `link()`, recibe el presentador, las acciones y los parámetros como argumentos. Crea un enlace y lo compara con la URL actual. Si es diferente, redirige al enlace generado.
385
385
386
386
```php
387
-
public function actionShow(int $id, string $slug = null): void
387
+
public function actionShow(int $id, ?string $slug = null): void
Copy file name to clipboardexpand all lines: application/fr/presenters.texy
+3-3
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ Similaire à la méthode `render<View>()`. Alors que `render<View>()` a pour but
60
60
61
61
Il est important que `action<Action>()` soit appelé avant `render<View>()`afin qu'à l'intérieur de celui-ci, nous puissions éventuellement modifier le cours suivant du cycle de vie, c'est-à-dire changer le modèle qui sera rendu et également la méthode `render<View>()` qui sera appelée, en utilisant `setView('otherView')`.
62
62
63
-
Les paramètres de la requête sont transmis à la méthode. Il est possible et recommandé de spécifier des types pour les paramètres, par exemple `actionShow(int $id, string $slug = null)` - si le paramètre `id` est manquant ou s'il ne s'agit pas d'un nombre entier, le présentateur renvoie l'[erreur 404 |#Error 404 etc.] et met fin à l'opération.
63
+
Les paramètres de la requête sont transmis à la méthode. Il est possible et recommandé de spécifier des types pour les paramètres, par exemple `actionShow(int $id, ?string $slug = null)` - si le paramètre `id` est manquant ou s'il ne s'agit pas d'un nombre entier, le présentateur renvoie l'[erreur 404 |#Error 404 etc.] et met fin à l'opération.
@@ -205,7 +205,7 @@ Dans le modèle, ces messages sont disponibles dans la variable `$flashes` en ta
205
205
Erreur 404 etc. .[#toc-error-404-etc]
206
206
=====================================
207
207
208
-
Lorsque nous ne pouvons pas répondre à la demande, par exemple parce que l'article que nous voulons afficher n'existe pas dans la base de données, nous envoyons l'erreur 404 en utilisant la méthode `error(string $message = null, int $httpCode = 404)`, qui représente l'erreur HTTP 404 :
208
+
Lorsque nous ne pouvons pas répondre à la demande, par exemple parce que l'article que nous voulons afficher n'existe pas dans la base de données, nous envoyons l'erreur 404 en utilisant la méthode `error(?string $message = null, int $httpCode = 404)`, qui représente l'erreur HTTP 404 :
209
209
210
210
```php
211
211
public function renderShow(int $id): void
@@ -384,7 +384,7 @@ La redirection ne se produit pas avec une demande AJAX ou POST, car elle entraî
384
384
Vous pouvez également invoquer la canonisation manuellement à l'aide de la méthode `canonicalize()`, qui, comme la méthode `link()`, reçoit le présentateur, les actions et les paramètres comme arguments. Elle crée un lien et le compare à l'URL actuelle. Si elle est différente, elle redirige vers le lien généré.
385
385
386
386
```php
387
-
public function actionShow(int $id, string $slug = null): void
387
+
public function actionShow(int $id, ?string $slug = null): void
0 commit comments