Skip to content

Commit 0cffe02

Browse files
mildabredg
authored andcommitted
application: improvements (#993)(#999)(#1002)
1 parent c8c3135 commit 0cffe02

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+304
-64
lines changed

application/bg/bootstrap.texy

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,20 @@ $configurator->addStaticParameters([
174174
]);
175175
```
176176

177-
Конфигурационните файлове могат да използват нормалния запис `%projectId%` за достъп до параметъра с име `projectId`. По подразбиране конфигураторът попълва следните параметри: `appDir`, `wwwDir`, `tempDir`, `vendorDir`, `debugMode` и `consoleMode`.
177+
В конфигурационните файлове можем да запишем обичайната нотация `%projectId%`, за да получим достъп до параметъра с име `projectId`.
178+
179+
180+
Параметри по подразбиране .[#toc-default-parameters]
181+
----------------------------------------------------
182+
183+
Можете да използвате следните статични параметри в конфигурационните файлове:
184+
185+
- `$appDir` е абсолютният път до директорията на файла `Bootstrap.php`
186+
- `$wwwDir` е абсолютният път до директорията, съдържаща входния файл `index.php`
187+
- `$tempDir` е абсолютният път до директорията за временни файлове
188+
- `$vendorDir` е абсолютният път до директорията, в която Composer инсталира библиотеки
189+
- `$debugMode` показва дали приложението е в режим на отстраняване на грешки
190+
- `$consoleMode` показва дали заявката е постъпила от командния ред
178191

179192

180193
Динамични параметри .[#toc-dynamic-parameters]

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/bootstrap.texy

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,20 @@ $configurator->addStaticParameters([
174174
]);
175175
```
176176

177-
Na parametr `projectId` se lze v konfiguraci odkázat obvyklým zápisem `%projectId%`. Třída Configurator automaticky přidává parametry `appDir`, `wwwDir`, `tempDir`, `vendorDir`, `debugMode` a `consoleMode`.
177+
Na parametr `projectId` se lze v konfiguraci odkázat obvyklým zápisem `%projectId%`.
178+
179+
180+
Výchozí parametry
181+
-----------------
182+
183+
V konfiguračních souborech můžete využít tyto statické parametry:
184+
185+
- `$appDir` je absolutní cesta k adresáři se souborem `Bootstrap.php`
186+
- `$wwwDir` je absolutní cesta k adresáři se vstupním souborem `index.php`
187+
- `$tempDir` je absolutní cesta k adresáři pro dočasné soubory
188+
- `$vendorDir` je absolutní cesta k adresáři, kam Composer instaluje knihovny
189+
- `$debugMode` udává, zda je aplikace v debugovacím režimu
190+
- `$consoleMode` udává, zda request přišel přes příkazovou řádku
178191

179192

180193
Dynamické parametry

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/bootstrap.texy

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,20 @@ $configurator->addStaticParameters([
174174
]);
175175
```
176176

177-
In Konfigurationsdateien können wir die übliche Notation `%projectId%` verwenden, um auf den Parameter mit dem Namen `projectId` zuzugreifen. Standardmäßig füllt der Configurator die folgenden Parameter aus: `appDir`, `wwwDir`, `tempDir`, `vendorDir`, `debugMode` und `consoleMode`.
177+
In Konfigurationsdateien können wir die übliche Notation `%projectId%` verwenden, um auf den Parameter `projectId` zuzugreifen.
178+
179+
180+
Standard-Parameter .[#toc-default-parameters]
181+
---------------------------------------------
182+
183+
Sie können die folgenden statischen Parameter in den Konfigurationsdateien verwenden:
184+
185+
- `$appDir` ist der absolute Pfad zu dem Verzeichnis, in dem sich die Datei `Bootstrap.php` befindet
186+
- `$wwwDir` ist der absolute Pfad zu dem Verzeichnis, das die `index.php` Eintragsdatei enthält
187+
- `$tempDir` ist der absolute Pfad zu dem Verzeichnis für temporäre Dateien
188+
- `$vendorDir` ist der absolute Pfad zu dem Verzeichnis, in dem Composer die Bibliotheken installiert
189+
- `$debugMode` gibt an, ob sich die Anwendung im Debug-Modus befindet
190+
- `$consoleMode` zeigt an, ob die Anfrage über die Befehlszeile kam
178191

179192

180193
Dynamische Parameter .[#toc-dynamic-parameters]

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/bootstrap.texy

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,20 @@ $configurator->addStaticParameters([
174174
]);
175175
```
176176

177-
Στα αρχεία ρυθμίσεων, μπορούμε να γράψουμε τον συνήθη συμβολισμό `%projectId%` για να αποκτήσουμε πρόσβαση στην παράμετρο με το όνομα `projectId`. Από προεπιλογή, ο διαμορφωτής συμπληρώνει τις ακόλουθες παραμέτρους: `appDir`, `wwwDir`, `tempDir`, `vendorDir`, `debugMode` και `consoleMode`.
177+
Στα αρχεία ρυθμίσεων, μπορούμε να γράψουμε τον συνήθη συμβολισμό `%projectId%` για να αποκτήσουμε πρόσβαση στην παράμετρο με το όνομα `projectId`.
178+
179+
180+
Προεπιλεγμένες παράμετροι .[#toc-default-parameters]
181+
----------------------------------------------------
182+
183+
Μπορείτε να χρησιμοποιήσετε τις ακόλουθες στατικές παραμέτρους στα αρχεία διαμόρφωσης:
184+
185+
- `$appDir` είναι η απόλυτη διαδρομή προς τον κατάλογο του αρχείου `Bootstrap.php`
186+
- `$wwwDir` είναι η απόλυτη διαδρομή προς τον κατάλογο που περιέχει το αρχείο καταχώρησης `index.php`
187+
- `$tempDir` είναι η απόλυτη διαδρομή προς τον κατάλογο για τα προσωρινά αρχεία
188+
- `$vendorDir` είναι η απόλυτη διαδρομή προς τον κατάλογο όπου ο Composer εγκαθιστά τις βιβλιοθήκες
189+
- Το `$debugMode` δηλώνει αν η εφαρμογή βρίσκεται σε κατάσταση αποσφαλμάτωσης.
190+
- Το `$consoleMode` δηλώνει αν η αίτηση υποβλήθηκε μέσω της γραμμής εντολών.
178191

179192

180193
Δυναμικές παράμετροι .[#toc-dynamic-parameters]

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/bootstrap.texy

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,20 @@ $configurator->addStaticParameters([
174174
]);
175175
```
176176

177-
In configuration files, we can write usual notation `%projectId%` to access the parameter named `projectId`. By default, the Configurator populates the following parameters: `appDir`, `wwwDir`, `tempDir`, `vendorDir`, `debugMode` and `consoleMode`.
177+
In configuration files, we can write usual notation `%projectId%` to access the parameter named `projectId`.
178+
179+
180+
Default Parameters
181+
------------------
182+
183+
You can use the following static parameters in the configuration files:
184+
185+
- `$appDir` is the absolute path to the directory of `Bootstrap.php` file
186+
- `$wwwDir` is the absolute path to the directory containing the `index.php` entry file
187+
- `$tempDir` is the absolute path to the directory for temporary files
188+
- `$vendorDir` is the absolute path to the directory where Composer installs libraries
189+
- `$debugMode` indicates whether the application is in debug mode
190+
- `$consoleMode` indicates whether the request came through the command line
178191

179192

180193
Dynamic Parameters

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

application/es/bootstrap.texy

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,20 @@ $configurator->addStaticParameters([
174174
]);
175175
```
176176

177-
En los archivos de configuración, podemos escribir la notación habitual `%projectId%` para acceder al parámetro denominado `projectId`. Por defecto, el Configurador rellena los siguientes parámetros: `appDir`, `wwwDir`, `tempDir`, `vendorDir`, `debugMode` y `consoleMode`.
177+
En los archivos de configuración, podemos escribir la notación habitual `%projectId%` para acceder al parámetro denominado `projectId`.
178+
179+
180+
Parámetros por defecto .[#toc-default-parameters]
181+
-------------------------------------------------
182+
183+
Puede utilizar los siguientes parámetros estáticos en los archivos de configuración:
184+
185+
- `$appDir` es la ruta absoluta al directorio del archivo `Bootstrap.php`
186+
- `$wwwDir` es la ruta absoluta al directorio que contiene el archivo de entrada `index.php`
187+
- `$tempDir` es la ruta absoluta al directorio para los archivos temporales
188+
- `$vendorDir` es la ruta absoluta al directorio donde Composer instala las bibliotecas
189+
- `$debugMode` indica si la aplicación está en modo depuración
190+
- `$consoleMode` indica si la solicitud llegó a través de la línea de comandos
178191

179192

180193
Parámetros dinámicos .[#toc-dynamic-parameters]

application/es/presenters.texy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ El `forward()` cambia al nuevo presentador inmediatamente sin redirección HTTP:
158158
$this->forward('Product:show');
159159
```
160160

161-
Ejemplo de redirección temporal con código HTTP 302 o 303:
161+
Ejemplo de una redirección temporal con código HTTP 302 (o 303, si el método de solicitud actual es POST):
162162

163163
```php
164164
$this->redirect('Product:show', $id);
@@ -170,7 +170,7 @@ Para conseguir una redirección permanente con código HTTP 301 utilice:
170170
$this->redirectPermanent('Product:show', $id);
171171
```
172172

173-
Puede redirigir a otra URL fuera de la aplicación con el método `redirectUrl()`:
173+
Puede redirigir a otra URL fuera de la aplicación utilizando el método `redirectUrl()`. El código HTTP puede especificarse como segundo parámetro, siendo el predeterminado 302 (o 303, si el método de solicitud actual es POST):
174174

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

application/es/templates.texy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ La ruta a las plantillas se deduce según una lógica simple. Se intenta ver si
4242
- `templates/<Presenter>/<view>.latte`
4343
- `templates/<Presenter>.<view>.latte`
4444

45-
Si no encuentra la plantilla, la respuesta es [error 404 |presenters#Error 404 etc.].
45+
Si no se encuentra la plantilla, se intentará buscar en el directorio `templates` un nivel más arriba, es decir, al mismo nivel que el directorio con la clase presentadora.
46+
47+
Si la plantilla tampoco se encuentra allí, la respuesta es un [error 404 |presenters#Error 404 etc.].
4648

4749
También puede cambiar la vista utilizando `$this->setView('otherView')`. O, en lugar de buscar, especifique directamente el nombre del archivo de plantilla utilizando `$this->template->setFile('/path/to/template.latte')`.
4850

0 commit comments

Comments
 (0)