Skip to content

Commit

Permalink
components: added info about redirect after signal [Closes #1017]
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Oct 23, 2024
1 parent 2381d0d commit a75ee13
Show file tree
Hide file tree
Showing 16 changed files with 352 additions and 0 deletions.
22 changes: 22 additions & 0 deletions application/bg/components.texy
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,28 @@ $this->redirect(/* ... */); // пренасочване
```


Пренасочване след сигнал .[#toc-redirection-after-a-signal]
===========================================================

След обработката на сигнал от компонент често следва пренасочване. Тази ситуация е подобна на формулярите - след изпращане на формуляр също пренасочваме, за да предотвратим повторното изпращане на данни, когато страницата се опреснява в браузъра.

```php
$this->redirect('this') // redirects to the current presenter and action
```

Тъй като компонентът е елемент за многократна употреба и обикновено не трябва да има пряка зависимост от конкретни презентатори, методите `redirect()` и `link()` автоматично интерпретират параметъра като сигнал за компонент:

```php
$this->redirect('click') // redirects to the 'click' signal of the same component
```

Ако трябва да пренасочите към друг презентатор или действие, можете да го направите чрез презентатора:

```php
$this->getPresenter()->redirect('Product:show'); // redirects to a different presenter/action
```


Постоянни параметри .[#toc-persistent-parameters]
=================================================

Expand Down
22 changes: 22 additions & 0 deletions application/cs/components.texy
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,28 @@ $this->redirect(/* ... */); // a přesměrujeme
```


Přesměrování po signálu
=======================

Po zpracování signálu komponenty často následuje přesměrování. Je to podobná situace jako u formulářů - po jejich odeslání také přesměrováváme, aby při obnovení stránky v prohlížeči nedošlo k opětovnému odeslání dat.

```php
$this->redirect('this') // přesměruje na aktuální presenter a action
```

Protože komponenta je znovupoužitelný prvek a obvykle by neměla mít přímou vazbu na konkrétní presentery, metody `redirect()` a `link()` automaticky interpretují parametr jako signál komponenty:

```php
$this->redirect('click') // přesměruje na signál 'click' téže komponenty
```

Pokud potřebujete přesměrovat na jiný presenter či akci, můžete to udělat prostřednictvím presenteru:

```php
$this->getPresenter()->redirect('Product:show'); // přesměruje na jiný presenter/action
```


Persistentní parametry
======================

Expand Down
22 changes: 22 additions & 0 deletions application/de/components.texy
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,28 @@ In der Vorlage stehen diese Meldungen in der Variablen `$flashes` als Objekte `s
```


Umleitung nach einem Signal .[#toc-redirection-after-a-signal]
==============================================================

Nach der Verarbeitung eines Komponentensignals folgt oft eine Umleitung. Diese Situation ist ähnlich wie bei Formularen - nach dem Absenden eines Formulars leiten wir ebenfalls um, um eine erneute Übermittlung von Daten zu verhindern, wenn die Seite im Browser aktualisiert wird.

```php
$this->redirect('this') // redirects to the current presenter and action
```

Da eine Komponente ein wiederverwendbares Element ist und in der Regel keine direkte Abhängigkeit von bestimmten Presentern haben sollte, interpretieren die Methoden `redirect()` und `link()` den Parameter automatisch als Komponentensignal:

```php
$this->redirect('click') // redirects to the 'click' signal of the same component
```

Wenn Sie zu einem anderen Präsentator oder einer Aktion umleiten müssen, können Sie dies über den Präsentator tun:

```php
$this->getPresenter()->redirect('Product:show'); // redirects to a different presenter/action
```


Dauerhafte Parameter .[#toc-persistent-parameters]
==================================================

Expand Down
22 changes: 22 additions & 0 deletions application/el/components.texy
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,28 @@ $this->redirect(/* ... */); // και ανακατεύθυνση
```


Επανακατεύθυνση μετά από ένα σήμα .[#toc-redirection-after-a-signal]
====================================================================

Μετά την επεξεργασία ενός σήματος συνιστωσών, ακολουθεί συχνά ανακατεύθυνση. Αυτή η κατάσταση είναι παρόμοια με τις φόρμες - μετά την υποβολή μιας φόρμας, κάνουμε επίσης ανακατεύθυνση για να αποτρέψουμε την εκ νέου υποβολή δεδομένων όταν η σελίδα ανανεώνεται στο πρόγραμμα περιήγησης.

```php
$this->redirect('this') // redirects to the current presenter and action
```

Δεδομένου ότι ένα συστατικό είναι ένα επαναχρησιμοποιήσιμο στοιχείο και συνήθως δεν πρέπει να έχει άμεση εξάρτηση από συγκεκριμένους παρουσιαστές, οι μέθοδοι `redirect()` και `link()` ερμηνεύουν αυτόματα την παράμετρο ως σήμα συστατικού:

```php
$this->redirect('click') // redirects to the 'click' signal of the same component
```

Εάν χρειάζεται να ανακατευθύνετε σε διαφορετικό παρουσιαστή ή ενέργεια, μπορείτε να το κάνετε μέσω του παρουσιαστή:

```php
$this->getPresenter()->redirect('Product:show'); // redirects to a different presenter/action
```


Μόνιμες παράμετροι .[#toc-persistent-parameters]
================================================

Expand Down
22 changes: 22 additions & 0 deletions application/en/components.texy
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,28 @@ In the template, these messages are available in the variable `$flashes` as obje
```


Redirection After a Signal
==========================

After processing a component signal, redirection often follows. This situation is similar to forms—after submitting a form, we also redirect to prevent resubmission of data when the page is refreshed in the browser.

```php
$this->redirect('this') // redirects to the current presenter and action
```

Since a component is a reusable element and should not usually have a direct dependency on specific presenters, the `redirect()` and `link()` methods automatically interpret the parameter as a component signal:

```php
$this->redirect('click') // redirects to the 'click' signal of the same component
```

If you need to redirect to a different presenter or action, you can do so through the presenter:

```php
$this->getPresenter()->redirect('Product:show'); // redirects to a different presenter/action
```


Persistent Parameters
=====================

Expand Down
22 changes: 22 additions & 0 deletions application/es/components.texy
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,28 @@ En la plantilla, estos mensajes están disponibles en la variable `$flashes` com
```


Redirección tras una señal .[#toc-redirection-after-a-signal]
=============================================================

Después de procesar una señal de componente, a menudo se produce una redirección. Esta situación es similar a la de los formularios: después de enviar un formulario, también redirigimos para evitar que se vuelvan a enviar los datos cuando se actualiza la página en el navegador.

```php
$this->redirect('this') // redirects to the current presenter and action
```

Dado que un componente es un elemento reutilizable y, por lo general, no debería tener una dependencia directa de presentadores específicos, los métodos `redirect()` y `link()` interpretan automáticamente el parámetro como una señal de componente:

```php
$this->redirect('click') // redirects to the 'click' signal of the same component
```

Si necesita redirigir a un presentador o acción diferente, puede hacerlo a través del presentador:

```php
$this->getPresenter()->redirect('Product:show'); // redirects to a different presenter/action
```


Parámetros persistentes .[#toc-persistent-parameters]
=====================================================

Expand Down
22 changes: 22 additions & 0 deletions application/fr/components.texy
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,28 @@ Dans le modèle, ces messages sont disponibles dans la variable `$flashes` sous
```


Redirection après un signal .[#toc-redirection-after-a-signal]
==============================================================

Le traitement d'un signal de composant est souvent suivi d'une redirection. Cette situation est similaire à celle des formulaires : après avoir soumis un formulaire, nous redirigeons également les données pour éviter qu'elles ne soient soumises à nouveau lorsque la page est rafraîchie dans le navigateur.

```php
$this->redirect('this') // redirects to the current presenter and action
```

Étant donné qu'un composant est un élément réutilisable et qu'il ne doit généralement pas dépendre directement de présentateurs spécifiques, les méthodes `redirect()` et `link()` interprètent automatiquement le paramètre comme un signal de composant :

```php
$this->redirect('click') // redirects to the 'click' signal of the same component
```

Si vous devez rediriger vers un autre présentateur ou une autre action, vous pouvez le faire par l'intermédiaire du présentateur :

```php
$this->getPresenter()->redirect('Product:show'); // redirects to a different presenter/action
```


Paramètres persistants .[#toc-persistent-parameters]
====================================================

Expand Down
22 changes: 22 additions & 0 deletions application/hu/components.texy
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,28 @@ A sablonban ezek az üzenetek a `$flashes` változóban állnak rendelkezésre,
```


Átirányítás jelzést követően .[#toc-redirection-after-a-signal]
===============================================================

Egy komponensjel feldolgozása után gyakran következik az átirányítás. Ez a helyzet hasonló az űrlapokhoz - egy űrlap elküldése után mi is átirányítunk, hogy megakadályozzuk az adatok újbóli elküldését, amikor az oldal frissül a böngészőben.

```php
$this->redirect('this') // redirects to the current presenter and action
```

Mivel a komponens egy újrafelhasználható elem, és általában nem szabad, hogy közvetlen függőségben álljon az egyes prezenterektől, a `redirect()` és a `link()` metódusok automatikusan komponensjelként értelmezik a paramétert:

```php
$this->redirect('click') // redirects to the 'click' signal of the same component
```

Ha át kell irányítani egy másik prezenterre vagy műveletre, akkor ezt a prezenteren keresztül teheti meg:

```php
$this->getPresenter()->redirect('Product:show'); // redirects to a different presenter/action
```


Állandó paraméterek .[#toc-persistent-parameters]
=================================================

Expand Down
22 changes: 22 additions & 0 deletions application/it/components.texy
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,28 @@ Nel modello, questi messaggi sono disponibili nella variabile `$flashes` come og
```


Reindirizzamento dopo un segnale .[#toc-redirection-after-a-signal]
===================================================================

Dopo l'elaborazione di un segnale di un componente, spesso segue un reindirizzamento. Questa situazione è simile a quella dei moduli: dopo l'invio di un modulo, si effettua un reindirizzamento per evitare che i dati vengano inviati nuovamente quando la pagina viene aggiornata nel browser.

```php
$this->redirect('this') // redirects to the current presenter and action
```

Poiché un componente è un elemento riutilizzabile e di solito non dovrebbe avere una dipendenza diretta da presentatori specifici, i metodi `redirect()` e `link()` interpretano automaticamente il parametro come un segnale di componente:

```php
$this->redirect('click') // redirects to the 'click' signal of the same component
```

Se è necessario reindirizzare a un presentatore o a un'azione diversa, lo si può fare attraverso il presentatore:

```php
$this->getPresenter()->redirect('Product:show'); // redirects to a different presenter/action
```


Parametri persistenti .[#toc-persistent-parameters]
===================================================

Expand Down
22 changes: 22 additions & 0 deletions application/pl/components.texy
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,28 @@ Do szablonu wiadomości te są dostępne w zmiennej `$flashes` jako obiekty `std
```


Przekierowanie po sygnale .[#toc-redirection-after-a-signal]
============================================================

Po przetworzeniu sygnału komponentu często następuje przekierowanie. Sytuacja ta jest podobna do formularzy - po przesłaniu formularza również przekierowujemy, aby zapobiec ponownemu przesłaniu danych po odświeżeniu strony w przeglądarce.

```php
$this->redirect('this') // redirects to the current presenter and action
```

Ponieważ komponent jest elementem wielokrotnego użytku i zwykle nie powinien mieć bezpośredniej zależności od konkretnych prezenterów, metody `redirect()` i `link()` automatycznie interpretują parametr jako sygnał komponentu:

```php
$this->redirect('click') // redirects to the 'click' signal of the same component
```

Jeśli konieczne jest przekierowanie do innego prezentera lub akcji, można to zrobić za pośrednictwem prezentera:

```php
$this->getPresenter()->redirect('Product:show'); // redirects to a different presenter/action
```


Trwałe parametry .[#toc-persistent-parameters]
==============================================

Expand Down
22 changes: 22 additions & 0 deletions application/pt/components.texy
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,28 @@ No modelo, estas mensagens estão disponíveis na variável `$flashes` como obje
```


Redirecionamento após um sinal .[#toc-redirection-after-a-signal]
=================================================================

Depois de processar um sinal de componente, o redirecionamento geralmente é feito. Essa situação é semelhante à dos formulários: após o envio de um formulário, também redirecionamos para evitar o reenvio de dados quando a página é atualizada no navegador.

```php
$this->redirect('this') // redirects to the current presenter and action
```

Como um componente é um elemento reutilizável e normalmente não deve ter uma dependência direta de apresentadores específicos, os métodos `redirect()` e `link()` interpretam automaticamente o parâmetro como um sinal de componente:

```php
$this->redirect('click') // redirects to the 'click' signal of the same component
```

Se precisar redirecionar para um apresentador ou ação diferente, você poderá fazer isso por meio do apresentador:

```php
$this->getPresenter()->redirect('Product:show'); // redirects to a different presenter/action
```


Parâmetros Persistentes .[#toc-persistent-parameters]
=====================================================

Expand Down
22 changes: 22 additions & 0 deletions application/ro/components.texy
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,28 @@ $this->redirect(/* ... */); // și redirecționarea
```


Redirecționarea după un semnal .[#toc-redirection-after-a-signal]
=================================================================

După procesarea unui semnal de componentă, urmează adesea redirecționarea. Această situație este similară formularelor - după trimiterea unui formular, redirecționăm, de asemenea, pentru a preveni retrimiterea datelor atunci când pagina este reîmprospătată în browser.

```php
$this->redirect('this') // redirects to the current presenter and action
```

Deoarece o componentă este un element reutilizabil și de obicei nu ar trebui să aibă o dependență directă de anumiți prezentatori, metodele `redirect()` și `link()` interpretează automat parametrul ca fiind un semnal de componentă:

```php
$this->redirect('click') // redirects to the 'click' signal of the same component
```

Dacă trebuie să redirecționați către un alt prezentator sau acțiune, puteți face acest lucru prin intermediul prezentatorului:

```php
$this->getPresenter()->redirect('Product:show'); // redirects to a different presenter/action
```


Parametrii persistenți .[#toc-persistent-parameters]
====================================================

Expand Down
22 changes: 22 additions & 0 deletions application/ru/components.texy
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,28 @@ $this->redirect(/* ... */); // делаем редирект
```


Перенаправление после сигнала .[#toc-redirection-after-a-signal]
================================================================

После обработки сигнала компонента часто следует перенаправление. Эта ситуация похожа на ситуацию с формами - после отправки формы мы также делаем перенаправление, чтобы предотвратить повторную отправку данных при обновлении страницы в браузере.

```php
$this->redirect('this') // redirects to the current presenter and action
```

Поскольку компонент - это многократно используемый элемент и обычно не должен иметь прямой зависимости от конкретных презентаторов, методы `redirect()` и `link()` автоматически интерпретируют параметр как сигнал компонента:

```php
$this->redirect('click') // redirects to the 'click' signal of the same component
```

Если вам нужно перенаправить на другого ведущего или действие, вы можете сделать это через ведущего:

```php
$this->getPresenter()->redirect('Product:show'); // redirects to a different presenter/action
```


Постоянные параметры .[#toc-persistent-parameters]
==================================================

Expand Down
Loading

0 comments on commit a75ee13

Please sign in to comment.