From e7af684ad8021f0c7d1e2b646bfc0f632dee5eca Mon Sep 17 00:00:00 2001 From: David Grudl Date: Thu, 18 Apr 2024 18:04:12 +0200 Subject: [PATCH] new directory structure --- application/bg/routing.texy | 10 ++++---- application/bg/templates.texy | 6 ++--- application/cs/routing.texy | 10 ++++---- application/cs/templates.texy | 6 ++--- application/de/routing.texy | 10 ++++---- application/de/templates.texy | 6 ++--- application/el/routing.texy | 10 ++++---- application/el/templates.texy | 6 ++--- application/en/routing.texy | 10 ++++---- application/en/templates.texy | 6 ++--- application/es/routing.texy | 10 ++++---- application/es/templates.texy | 6 ++--- application/fr/routing.texy | 10 ++++---- application/fr/templates.texy | 6 ++--- application/hu/routing.texy | 10 ++++---- application/hu/templates.texy | 6 ++--- application/it/routing.texy | 10 ++++---- application/it/templates.texy | 6 ++--- application/pl/routing.texy | 10 ++++---- application/pl/templates.texy | 6 ++--- application/pt/routing.texy | 10 ++++---- application/pt/templates.texy | 6 ++--- application/ro/routing.texy | 10 ++++---- application/ro/templates.texy | 6 ++--- application/ru/routing.texy | 10 ++++---- application/ru/templates.texy | 6 ++--- application/sl/routing.texy | 10 ++++---- application/sl/templates.texy | 6 ++--- application/tr/routing.texy | 10 ++++---- application/tr/templates.texy | 6 ++--- application/uk/routing.texy | 10 ++++---- application/uk/templates.texy | 6 ++--- best-practices/bg/composer.texy | 2 +- best-practices/bg/pagination.texy | 10 +++----- best-practices/cs/composer.texy | 2 +- best-practices/cs/pagination.texy | 10 +++----- best-practices/de/composer.texy | 2 +- best-practices/de/pagination.texy | 10 +++----- best-practices/el/composer.texy | 2 +- best-practices/el/pagination.texy | 10 +++----- best-practices/en/composer.texy | 2 +- best-practices/en/pagination.texy | 10 +++----- best-practices/es/composer.texy | 2 +- best-practices/es/pagination.texy | 10 +++----- best-practices/fr/composer.texy | 2 +- best-practices/fr/pagination.texy | 10 +++----- best-practices/hu/composer.texy | 2 +- best-practices/hu/pagination.texy | 10 +++----- best-practices/it/composer.texy | 2 +- best-practices/it/pagination.texy | 10 +++----- best-practices/pl/composer.texy | 2 +- best-practices/pl/pagination.texy | 10 +++----- best-practices/pt/composer.texy | 2 +- best-practices/pt/pagination.texy | 10 +++----- best-practices/ro/composer.texy | 2 +- best-practices/ro/pagination.texy | 10 +++----- best-practices/ru/composer.texy | 2 +- best-practices/ru/pagination.texy | 10 +++----- best-practices/sl/composer.texy | 2 +- best-practices/sl/pagination.texy | 10 +++----- best-practices/tr/composer.texy | 2 +- best-practices/tr/pagination.texy | 10 +++----- best-practices/uk/composer.texy | 2 +- best-practices/uk/pagination.texy | 10 +++----- dependency-injection/bg/configuration.texy | 2 +- dependency-injection/bg/factory.texy | 2 +- dependency-injection/cs/configuration.texy | 2 +- dependency-injection/cs/factory.texy | 2 +- dependency-injection/de/configuration.texy | 2 +- dependency-injection/de/factory.texy | 2 +- dependency-injection/el/configuration.texy | 2 +- dependency-injection/el/factory.texy | 2 +- dependency-injection/en/configuration.texy | 2 +- dependency-injection/en/factory.texy | 2 +- dependency-injection/es/configuration.texy | 2 +- dependency-injection/es/factory.texy | 2 +- dependency-injection/fr/configuration.texy | 2 +- dependency-injection/fr/factory.texy | 2 +- dependency-injection/hu/configuration.texy | 2 +- dependency-injection/hu/factory.texy | 2 +- dependency-injection/it/configuration.texy | 2 +- dependency-injection/it/factory.texy | 2 +- dependency-injection/ja/configuration.texy | 2 +- dependency-injection/ja/factory.texy | 2 +- dependency-injection/pl/configuration.texy | 2 +- dependency-injection/pl/factory.texy | 2 +- dependency-injection/pt/configuration.texy | 2 +- dependency-injection/pt/factory.texy | 2 +- dependency-injection/ro/configuration.texy | 2 +- dependency-injection/ro/factory.texy | 2 +- dependency-injection/ru/configuration.texy | 2 +- dependency-injection/ru/factory.texy | 2 +- dependency-injection/sl/configuration.texy | 2 +- dependency-injection/sl/factory.texy | 2 +- dependency-injection/tr/configuration.texy | 2 +- dependency-injection/tr/factory.texy | 2 +- dependency-injection/uk/configuration.texy | 2 +- dependency-injection/uk/factory.texy | 2 +- forms/bg/in-presenter.texy | 4 +-- forms/cs/in-presenter.texy | 4 +-- forms/de/in-presenter.texy | 4 +-- forms/el/in-presenter.texy | 4 +-- forms/en/in-presenter.texy | 4 +-- forms/es/in-presenter.texy | 4 +-- forms/fr/in-presenter.texy | 4 +-- forms/hu/in-presenter.texy | 4 +-- forms/it/in-presenter.texy | 4 +-- forms/pl/in-presenter.texy | 4 +-- forms/pt/in-presenter.texy | 4 +-- forms/ro/in-presenter.texy | 4 +-- forms/ru/in-presenter.texy | 4 +-- forms/sl/in-presenter.texy | 4 +-- forms/tr/in-presenter.texy | 4 +-- forms/uk/in-presenter.texy | 4 +-- quickstart/bg/@home.texy | 6 ++--- quickstart/bg/authentication.texy | 22 ++++++++-------- quickstart/bg/comments.texy | 14 +++++------ quickstart/bg/creating-posts.texy | 24 +++++++++--------- quickstart/bg/home-page.texy | 25 +++++++++--------- quickstart/bg/model.texy | 4 +-- quickstart/bg/single-post.texy | 28 ++++++++++----------- quickstart/cs/@home.texy | 6 ++--- quickstart/cs/authentication.texy | 18 ++++++------- quickstart/cs/comments.texy | 12 ++++----- quickstart/cs/creating-posts.texy | 22 ++++++++-------- quickstart/cs/home-page.texy | 21 ++++++++-------- quickstart/cs/model.texy | 4 +-- quickstart/cs/single-post.texy | 26 +++++++++---------- quickstart/de/@home.texy | 6 ++--- quickstart/de/authentication.texy | 18 ++++++------- quickstart/de/comments.texy | 12 ++++----- quickstart/de/creating-posts.texy | 22 ++++++++-------- quickstart/de/home-page.texy | 19 +++++++------- quickstart/de/model.texy | 4 +-- quickstart/de/single-post.texy | 26 +++++++++---------- quickstart/el/@home.texy | 6 ++--- quickstart/el/authentication.texy | 18 ++++++------- quickstart/el/comments.texy | 12 ++++----- quickstart/el/creating-posts.texy | 22 ++++++++-------- quickstart/el/home-page.texy | 19 +++++++------- quickstart/el/model.texy | 4 +-- quickstart/el/single-post.texy | 26 +++++++++---------- quickstart/en/@home.texy | 6 ++--- quickstart/en/authentication.texy | 18 ++++++------- quickstart/en/comments.texy | 12 ++++----- quickstart/en/creating-posts.texy | 22 ++++++++-------- quickstart/en/home-page.texy | 19 +++++++------- quickstart/en/model.texy | 4 +-- quickstart/en/single-post.texy | 26 +++++++++---------- quickstart/es/@home.texy | 6 ++--- quickstart/es/authentication.texy | 18 ++++++------- quickstart/es/comments.texy | 12 ++++----- quickstart/es/creating-posts.texy | 22 ++++++++-------- quickstart/es/home-page.texy | 19 +++++++------- quickstart/es/model.texy | 4 +-- quickstart/es/single-post.texy | 26 +++++++++---------- quickstart/files/qs-tracy.avif | Bin 0 -> 14828 bytes quickstart/files/qs-tracy.webp | Bin 40154 -> 0 bytes quickstart/fr/@home.texy | 6 ++--- quickstart/fr/authentication.texy | 18 ++++++------- quickstart/fr/comments.texy | 12 ++++----- quickstart/fr/creating-posts.texy | 22 ++++++++-------- quickstart/fr/home-page.texy | 19 +++++++------- quickstart/fr/model.texy | 4 +-- quickstart/fr/single-post.texy | 26 +++++++++---------- quickstart/hu/@home.texy | 6 ++--- quickstart/hu/authentication.texy | 18 ++++++------- quickstart/hu/comments.texy | 12 ++++----- quickstart/hu/creating-posts.texy | 22 ++++++++-------- quickstart/hu/home-page.texy | 19 +++++++------- quickstart/hu/model.texy | 4 +-- quickstart/hu/single-post.texy | 26 +++++++++---------- quickstart/it/@home.texy | 6 ++--- quickstart/it/authentication.texy | 18 ++++++------- quickstart/it/comments.texy | 12 ++++----- quickstart/it/creating-posts.texy | 22 ++++++++-------- quickstart/it/home-page.texy | 19 +++++++------- quickstart/it/model.texy | 4 +-- quickstart/it/single-post.texy | 26 +++++++++---------- quickstart/pl/@home.texy | 6 ++--- quickstart/pl/authentication.texy | 18 ++++++------- quickstart/pl/comments.texy | 12 ++++----- quickstart/pl/creating-posts.texy | 22 ++++++++-------- quickstart/pl/home-page.texy | 21 ++++++++-------- quickstart/pl/model.texy | 4 +-- quickstart/pl/single-post.texy | 26 +++++++++---------- quickstart/pt/@home.texy | 6 ++--- quickstart/pt/authentication.texy | 18 ++++++------- quickstart/pt/comments.texy | 12 ++++----- quickstart/pt/creating-posts.texy | 22 ++++++++-------- quickstart/pt/home-page.texy | 19 +++++++------- quickstart/pt/model.texy | 4 +-- quickstart/pt/single-post.texy | 26 +++++++++---------- quickstart/ro/@home.texy | 6 ++--- quickstart/ro/authentication.texy | 18 ++++++------- quickstart/ro/comments.texy | 12 ++++----- quickstart/ro/creating-posts.texy | 22 ++++++++-------- quickstart/ro/home-page.texy | 19 +++++++------- quickstart/ro/model.texy | 4 +-- quickstart/ro/single-post.texy | 26 +++++++++---------- quickstart/ru/@home.texy | 6 ++--- quickstart/ru/authentication.texy | 22 ++++++++-------- quickstart/ru/comments.texy | 14 +++++------ quickstart/ru/creating-posts.texy | 24 +++++++++--------- quickstart/ru/home-page.texy | 25 +++++++++--------- quickstart/ru/model.texy | 4 +-- quickstart/ru/single-post.texy | 28 ++++++++++----------- quickstart/sl/@home.texy | 6 ++--- quickstart/sl/authentication.texy | 18 ++++++------- quickstart/sl/comments.texy | 12 ++++----- quickstart/sl/creating-posts.texy | 22 ++++++++-------- quickstart/sl/home-page.texy | 19 +++++++------- quickstart/sl/model.texy | 4 +-- quickstart/sl/single-post.texy | 26 +++++++++---------- quickstart/tr/@home.texy | 6 ++--- quickstart/tr/authentication.texy | 18 ++++++------- quickstart/tr/comments.texy | 12 ++++----- quickstart/tr/creating-posts.texy | 22 ++++++++-------- quickstart/tr/home-page.texy | 19 +++++++------- quickstart/tr/model.texy | 4 +-- quickstart/tr/single-post.texy | 26 +++++++++---------- quickstart/uk/@home.texy | 6 ++--- quickstart/uk/authentication.texy | 22 ++++++++-------- quickstart/uk/comments.texy | 14 +++++------ quickstart/uk/creating-posts.texy | 24 +++++++++--------- quickstart/uk/home-page.texy | 25 +++++++++--------- quickstart/uk/model.texy | 4 +-- quickstart/uk/single-post.texy | 28 ++++++++++----------- robot-loader/bg/@home.texy | 2 +- robot-loader/cs/@home.texy | 2 +- robot-loader/de/@home.texy | 2 +- robot-loader/el/@home.texy | 2 +- robot-loader/en/@home.texy | 2 +- robot-loader/es/@home.texy | 2 +- robot-loader/fr/@home.texy | 2 +- robot-loader/hu/@home.texy | 2 +- robot-loader/it/@home.texy | 2 +- robot-loader/pl/@home.texy | 2 +- robot-loader/pt/@home.texy | 2 +- robot-loader/ro/@home.texy | 2 +- robot-loader/ru/@home.texy | 2 +- robot-loader/sl/@home.texy | 2 +- robot-loader/tr/@home.texy | 2 +- robot-loader/uk/@home.texy | 2 +- tracy/bg/guide.texy | 6 ++--- tracy/cs/guide.texy | 6 ++--- tracy/de/guide.texy | 6 ++--- tracy/el/guide.texy | 6 ++--- tracy/en/guide.texy | 6 ++--- tracy/es/guide.texy | 6 ++--- tracy/fr/guide.texy | 6 ++--- tracy/hu/guide.texy | 6 ++--- tracy/it/guide.texy | 6 ++--- tracy/pl/guide.texy | 6 ++--- tracy/pt/guide.texy | 6 ++--- tracy/ro/guide.texy | 6 ++--- tracy/ru/guide.texy | 6 ++--- tracy/sl/guide.texy | 6 ++--- tracy/tr/guide.texy | 6 ++--- tracy/uk/guide.texy | 6 ++--- 260 files changed, 1212 insertions(+), 1260 deletions(-) create mode 100644 quickstart/files/qs-tracy.avif delete mode 100644 quickstart/files/qs-tracy.webp diff --git a/application/bg/routing.texy b/application/bg/routing.texy index 300a7755e2..65cbbb144a 100644 --- a/application/bg/routing.texy +++ b/application/bg/routing.texy @@ -477,10 +477,10 @@ $router->addRoute('index', /* ... */); Интеграция .[#toc-integration] ============================== -За да свържем маршрутизатора си с приложението, трябва да информираме за това контейнера DI. Най-лесният начин е да се подготви фабрика, която ще създаде обект маршрутизатор, и да се каже на конфигурацията на контейнера да го използва. Да предположим, че напишем метод за това, `App\Router\RouterFactory::createRouter()`: +За да свържем маршрутизатора си с приложението, трябва да информираме за това контейнера DI. Най-лесният начин е да се подготви фабрика, която ще създаде обект маршрутизатор, и да се каже на конфигурацията на контейнера да го използва. Да предположим, че напишем метод за това, `App\Core\RouterFactory::createRouter()`: ```php -namespace App\Router; +namespace App\Core use Nette\Application\Routers\RouteList; @@ -499,7 +499,7 @@ class RouterFactory ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter ``` Всички зависимости, като например връзки към бази данни и т.н., се предават на метода на фабриката като параметри, като се използва [автоматично свързване |dependency-injection:autowiring]: @@ -663,7 +663,7 @@ $router->addRoute(/* ... */); Затова отново ще добавим метод, който ще създаде например маршрутизатор: ```php -namespace App\Router; +namespace App\Core; use Nette\Routing\RouteList; @@ -694,7 +694,7 @@ $httpRequest = $container->getByType(Nette\Http\IRequest::class); Или ще създадем обектите директно: ```php -$router = App\Router\RouterFactory::createRouter(); +$router = App\Core\RouterFactory::createRouter(); $httpRequest = (new Nette\Http\RequestFactory)->fromGlobals(); ``` diff --git a/application/bg/templates.texy b/application/bg/templates.texy index 850d3e2ecd..8b0021643e 100644 --- a/application/bg/templates.texy +++ b/application/bg/templates.texy @@ -104,7 +104,7 @@ class ArticleTemplate extends Nette\Bridges\ApplicationLatte\Template Можете също така да си позволите лукса да шепнете в шаблоните, просто инсталирайте плъгина Latte в PhpStorm и поставете името на класа в началото на шаблона, за повече информация вижте статията "Latte: как да въведем системата":https://blog.nette.org/bg/latte-kak-da-izpolzvame-sistemata-ot-tipove: ```latte -{templateType App\Presenters\ArticleTemplate} +{templateType App\UI\Article\ArticleTemplate} ... ``` @@ -176,7 +176,7 @@ public function beforeRender(): void Версия 3 на Latte предлага по-усъвършенстван начин за създаване на [разширение за |latte:creating-extension] всеки уеб проект. Ето кратък пример за такъв клас: ```php -namespace App\Templating; +namespace App\UI\Accessory; final class LatteExtension extends Latte\Extension { @@ -214,7 +214,7 @@ final class LatteExtension extends Latte\Extension ```neon latte: extensions: - - App\Templating\LatteExtension + - App\UI\Accessory\LatteExtension ``` diff --git a/application/cs/routing.texy b/application/cs/routing.texy index 3f58166681..0c04944a28 100644 --- a/application/cs/routing.texy +++ b/application/cs/routing.texy @@ -477,10 +477,10 @@ $router->addRoute('index', /* ... */); Začlenění do aplikace ===================== -Abychom vytvořený router zapojili do aplikace, musíme o něm říci DI kontejneru. Nejsnazší cesta je připravit továrnu, která objekt routeru vyrobí, a sdělit v konfiguraci kontejneru, že ji má použít. Dejme tomu, že k tomu účelu napíšeme metodu `App\Router\RouterFactory::createRouter()`: +Abychom vytvořený router zapojili do aplikace, musíme o něm říci DI kontejneru. Nejsnazší cesta je připravit továrnu, která objekt routeru vyrobí, a sdělit v konfiguraci kontejneru, že ji má použít. Dejme tomu, že k tomu účelu napíšeme metodu `App\Core\RouterFactory::createRouter()`: ```php -namespace App\Router; +namespace App\Core use Nette\Application\Routers\RouteList; @@ -499,7 +499,7 @@ Do [konfigurace |dependency-injection:services] pak zapíšeme: ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter ``` Jakékoliv závislosti, třeba na databázi atd, se předají tovární metodě jako její parametry pomocí [autowiringu|dependency-injection:autowiring]: @@ -663,7 +663,7 @@ Samostatným použitím myslíme využití schopností routeru v aplikaci, kter Takže opět si vytvoříme metodu, která nám sestaví router, např.: ```php -namespace App\Router; +namespace App\Core; use Nette\Routing\RouteList; @@ -694,7 +694,7 @@ $httpRequest = $container->getByType(Nette\Http\IRequest::class); Anebo objekty přímo vyrobíme: ```php -$router = App\Router\RouterFactory::createRouter(); +$router = App\Core\RouterFactory::createRouter(); $httpRequest = (new Nette\Http\RequestFactory)->fromGlobals(); ``` diff --git a/application/cs/templates.texy b/application/cs/templates.texy index 5d0de8dc1a..2a7d61caf8 100644 --- a/application/cs/templates.texy +++ b/application/cs/templates.texy @@ -104,7 +104,7 @@ Anotace `@property-read` je určená pro IDE a statickou analýzu, díky ní bud Luxusu našeptávání si můžete dopřát i v šablonách, stačí do PhpStorm nainstalovat plugin pro Latte a uvést na začátek šablony název třídy, více v článku "Latte: jak na typový systém":https://blog.nette.org/cs/latte-jak-na-typovy-system: ```latte -{templateType App\Presenters\ArticleTemplate} +{templateType App\UI\Article\ArticleTemplate} ... ``` @@ -176,7 +176,7 @@ public function beforeRender(): void Latte ve verzi 3 nabízí pokročilejší způsob a to vytvoření si [extension |latte:creating-extension] pro každý webový projekt. Kusý příklad takové třídy: ```php -namespace App\Templating; +namespace App\UI\Accessory; final class LatteExtension extends Latte\Extension { @@ -214,7 +214,7 @@ Zaregistrujeme ji pomocí [konfigurace |configuration#Šablony Latte]: ```neon latte: extensions: - - App\Templating\LatteExtension + - App\UI\Accessory\LatteExtension ``` diff --git a/application/de/routing.texy b/application/de/routing.texy index dac42c271d..a67737b64a 100644 --- a/application/de/routing.texy +++ b/application/de/routing.texy @@ -477,10 +477,10 @@ $router->addRoute('index', /* ... */); Einbindung .[#toc-integration] ============================== -Um unseren Router in die Anwendung einzubinden, müssen wir ihn dem DI-Container mitteilen. Am einfachsten ist es, die Fabrik vorzubereiten, die das Router-Objekt erstellt, und der Container-Konfiguration mitzuteilen, dass sie es verwenden soll. Schreiben wir also eine Methode für diesen Zweck `App\Router\RouterFactory::createRouter()`: +Um unseren Router in die Anwendung einzubinden, müssen wir ihn dem DI-Container mitteilen. Am einfachsten ist es, die Fabrik vorzubereiten, die das Router-Objekt erstellt, und der Container-Konfiguration mitzuteilen, dass sie es verwenden soll. Schreiben wir also eine Methode für diesen Zweck `App\Core\RouterFactory::createRouter()`: ```php -namespace App\Router; +namespace App\Core use Nette\Application\Routers\RouteList; @@ -499,7 +499,7 @@ Dann schreiben wir in [configuration |dependency-injection:services]: ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter ``` Alle Abhängigkeiten, wie z. B. eine Datenbankverbindung usw., werden der Factory-Methode als Parameter über [Autowiring |dependency-injection:autowiring] übergeben: @@ -663,7 +663,7 @@ Unter getrennter Nutzung verstehen wir die Verwendung der Router-Funktionen in e Wir werden also wieder eine Methode erstellen, die einen Router aufbaut, zum Beispiel: ```php -namespace App\Router; +namespace App\Core; use Nette\Routing\RouteList; @@ -694,7 +694,7 @@ $httpRequest = $container->getByType(Nette\Http\IRequest::class); Oder wir erstellen die Objekte direkt: ```php -$router = App\Router\RouterFactory::createRouter(); +$router = App\Core\RouterFactory::createRouter(); $httpRequest = (new Nette\Http\RequestFactory)->fromGlobals(); ``` diff --git a/application/de/templates.texy b/application/de/templates.texy index a21bd7266f..5fce7710c9 100644 --- a/application/de/templates.texy +++ b/application/de/templates.texy @@ -104,7 +104,7 @@ Die `@property-read` Annotation ist für die IDE und die statische Analyse, sie Sie können sich auch den Luxus gönnen, in Vorlagen zu flüstern. Installieren Sie einfach das Latte-Plugin in PhpStorm und geben Sie den Klassennamen am Anfang der Vorlage an, siehe den Artikel "Latte: how to type system":https://blog.nette.org/de/latte-wie-benutzt-man-das-typensystem: ```latte -{templateType App\Presenters\ArticleTemplate} +{templateType App\UI\Article\ArticleTemplate} ... ``` @@ -176,7 +176,7 @@ public function beforeRender(): void Latte Version 3 bietet einen fortgeschritteneren Weg, indem es eine [Erweiterung |latte:creating-extension] für jedes Webprojekt erstellt. Hier ist ein grobes Beispiel für eine solche Klasse: ```php -namespace App\Templating; +namespace App\UI\Accessory; final class LatteExtension extends Latte\Extension { @@ -214,7 +214,7 @@ Wir registrieren sie mit [configuration |configuration#Latte]: ```neon latte: extensions: - - App\Templating\LatteExtension + - App\UI\Accessory\LatteExtension ``` diff --git a/application/el/routing.texy b/application/el/routing.texy index 448fa6f67b..eaf6d22971 100644 --- a/application/el/routing.texy +++ b/application/el/routing.texy @@ -477,10 +477,10 @@ $router->addRoute('index', /* ... */); Ενσωμάτωση .[#toc-integration] ============================== -Για να συνδέσουμε τον δρομολογητή μας στην εφαρμογή, πρέπει να ενημερώσουμε το DI container σχετικά με αυτόν. Ο ευκολότερος τρόπος είναι να προετοιμάσουμε το εργοστάσιο που θα κατασκευάσει το αντικείμενο του δρομολογητή και να πούμε στη διαμόρφωση του δοχείου να το χρησιμοποιήσει. Ας πούμε λοιπόν ότι γράφουμε μια μέθοδο για το σκοπό αυτό `App\Router\RouterFactory::createRouter()`: +Για να συνδέσουμε τον δρομολογητή μας στην εφαρμογή, πρέπει να ενημερώσουμε το DI container σχετικά με αυτόν. Ο ευκολότερος τρόπος είναι να προετοιμάσουμε το εργοστάσιο που θα κατασκευάσει το αντικείμενο του δρομολογητή και να πούμε στη διαμόρφωση του δοχείου να το χρησιμοποιήσει. Ας πούμε λοιπόν ότι γράφουμε μια μέθοδο για το σκοπό αυτό `App\Core\RouterFactory::createRouter()`: ```php -namespace App\Router; +namespace App\Core use Nette\Application\Routers\RouteList; @@ -499,7 +499,7 @@ class RouterFactory ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter ``` Οποιεσδήποτε εξαρτήσεις, όπως μια σύνδεση βάσης δεδομένων κ.λπ., περνούν στη μέθοδο factory ως παράμετροι με τη χρήση [αυτόματης σύνδεσης |dependency-injection:autowiring]: @@ -663,7 +663,7 @@ $router->addRoute(/* ... */); Έτσι και πάλι θα δημιουργήσουμε μια μέθοδο που θα κατασκευάσει ένα δρομολογητή, για παράδειγμα: ```php -namespace App\Router; +namespace App\Core; use Nette\Routing\RouteList; @@ -694,7 +694,7 @@ $httpRequest = $container->getByType(Nette\Http\IRequest::class); Ή θα δημιουργήσουμε αντικείμενα απευθείας: ```php -$router = App\Router\RouterFactory::createRouter(); +$router = App\Core\RouterFactory::createRouter(); $httpRequest = (new Nette\Http\RequestFactory)->fromGlobals(); ``` diff --git a/application/el/templates.texy b/application/el/templates.texy index 4b83599f45..4b9206f55b 100644 --- a/application/el/templates.texy +++ b/application/el/templates.texy @@ -104,7 +104,7 @@ class ArticleTemplate extends Nette\Bridges\ApplicationLatte\Template Μπορείτε επίσης να αφεθείτε στην πολυτέλεια του ψιθυρίσματος στα πρότυπα, απλά εγκαταστήστε το πρόσθετο Latte στο PhpStorm και καθορίστε το όνομα της κλάσης στην αρχή του προτύπου, δείτε το άρθρο "Latte: πώς να πληκτρολογήσετε το σύστημα":https://blog.nette.org/el/latte-pos-na-chresimopoiesete-to-systema-typon: ```latte -{templateType App\Presenters\ArticleTemplate} +{templateType App\UI\Article\ArticleTemplate} ... ``` @@ -176,7 +176,7 @@ public function beforeRender(): void Latte έκδοση 3 προσφέρει έναν πιο προηγμένο τρόπο δημιουργώντας μια [επέκταση |latte:creating-extension] για κάθε έργο ιστού. Εδώ είναι ένα πρόχειρο παράδειγμα μιας τέτοιας κλάσης: ```php -namespace App\Templating; +namespace App\UI\Accessory; final class LatteExtension extends Latte\Extension { @@ -214,7 +214,7 @@ final class LatteExtension extends Latte\Extension ```neon latte: extensions: - - App\Templating\LatteExtension + - App\UI\Accessory\LatteExtension ``` diff --git a/application/en/routing.texy b/application/en/routing.texy index c35c692adb..c5c9e257eb 100644 --- a/application/en/routing.texy +++ b/application/en/routing.texy @@ -477,10 +477,10 @@ $router->addRoute('index', /* ... */); Integration =========== -In order to connect the our router into the application, we must tell the DI container about it. The easiest way is to prepare the factory that will build the router object and tell the container configuration to use it. So let's say we write a method for this purpose `App\Router\RouterFactory::createRouter()`: +In order to connect the our router into the application, we must tell the DI container about it. The easiest way is to prepare the factory that will build the router object and tell the container configuration to use it. So let's say we write a method for this purpose `App\Core\RouterFactory::createRouter()`: ```php -namespace App\Router; +namespace App\Core use Nette\Application\Routers\RouteList; @@ -499,7 +499,7 @@ Then we write in [configuration |dependency-injection:services]: ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter ``` Any dependencies, such as a database connection etc., are passed to the factory method as its parameters using [autowiring |dependency-injection:autowiring]: @@ -663,7 +663,7 @@ By separated usage, we mean the use of the router's capabilities in an applicati So again we will create a method that will build a router, for example: ```php -namespace App\Router; +namespace App\Core; use Nette\Routing\RouteList; @@ -694,7 +694,7 @@ $httpRequest = $container->getByType(Nette\Http\IRequest::class); Or we will create objects directly: ```php -$router = App\Router\RouterFactory::createRouter(); +$router = App\Core\RouterFactory::createRouter(); $httpRequest = (new Nette\Http\RequestFactory)->fromGlobals(); ``` diff --git a/application/en/templates.texy b/application/en/templates.texy index 5107b4493a..1de61c7084 100644 --- a/application/en/templates.texy +++ b/application/en/templates.texy @@ -104,7 +104,7 @@ The `@property-read` annotation is for IDE and static analysis, it will make aut You can indulge in the luxury of whispering in templates too, just install the Latte plugin in PhpStorm and specify the class name at the beginning of the template, see the article "Latte: how to type system":https://blog.nette.org/en/latte-how-to-use-type-system: ```latte -{templateType App\Presenters\ArticleTemplate} +{templateType App\UI\Article\ArticleTemplate} ... ``` @@ -176,7 +176,7 @@ public function beforeRender(): void Latte version 3 offers a more advanced way by creating an [extension |latte:creating-extension] for each web project. Here is a rough example of such a class: ```php -namespace App\Templating; +namespace App\UI\Accessory; final class LatteExtension extends Latte\Extension { @@ -214,7 +214,7 @@ We register it using [configuration#Latte]: ```neon latte: extensions: - - App\Templating\LatteExtension + - App\UI\Accessory\LatteExtension ``` diff --git a/application/es/routing.texy b/application/es/routing.texy index c6ed0f3950..b28e71d5e1 100644 --- a/application/es/routing.texy +++ b/application/es/routing.texy @@ -477,10 +477,10 @@ $router->addRoute('index', /* ... */); Integración .[#toc-integration] =============================== -Para conectar nuestro router a la aplicación, debemos informar al contenedor DI sobre él. La forma más sencilla es preparar la fábrica que construirá el objeto router y decirle a la configuración del contenedor que lo utilice. Digamos que escribimos un método para este propósito `App\Router\RouterFactory::createRouter()`: +Para conectar nuestro router a la aplicación, debemos informar al contenedor DI sobre él. La forma más sencilla es preparar la fábrica que construirá el objeto router y decirle a la configuración del contenedor que lo utilice. Digamos que escribimos un método para este propósito `App\Core\RouterFactory::createRouter()`: ```php -namespace App\Router; +namespace App\Core use Nette\Application\Routers\RouteList; @@ -499,7 +499,7 @@ Luego escribimos en [configuración |dependency-injection:services]: ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter ``` Cualquier dependencia, como una conexión de base de datos, etc., se pasa al método de fábrica como sus parámetros utilizando [autowiring |dependency-injection:autowiring]: @@ -663,7 +663,7 @@ Por uso separado, nos referimos al uso de las capacidades del router en una apli Así que de nuevo crearemos un método que construirá un enrutador, por ejemplo ```php -namespace App\Router; +namespace App\Core; use Nette\Routing\RouteList; @@ -694,7 +694,7 @@ $httpRequest = $container->getByType(Nette\Http\IRequest::class); O crearemos los objetos directamente: ```php -$router = App\Router\RouterFactory::createRouter(); +$router = App\Core\RouterFactory::createRouter(); $httpRequest = (new Nette\Http\RequestFactory)->fromGlobals(); ``` diff --git a/application/es/templates.texy b/application/es/templates.texy index 761f7a648e..1e7066c3f8 100644 --- a/application/es/templates.texy +++ b/application/es/templates.texy @@ -104,7 +104,7 @@ La anotación `@property-read` es para IDE y análisis estático, hará que func Puedes permitirte el lujo de susurrar en las plantillas también, simplemente instala el plugin Latte en PhpStorm y especifica el nombre de la clase al principio de la plantilla, ver el artículo "Latte: cómo escribir sistema:https://blog.nette.org/es/latte-como-utilizar-el-sistema-de-tipos": ```latte -{templateType App\Presenters\ArticleTemplate} +{templateType App\UI\Article\ArticleTemplate} ... ``` @@ -176,7 +176,7 @@ public function beforeRender(): void La versión 3 de Latte ofrece una forma más avanzada creando una [extensión |latte:creating-extension] para cada proyecto web. He aquí un ejemplo aproximado de una clase de este tipo: ```php -namespace App\Templating; +namespace App\UI\Accessory; final class LatteExtension extends Latte\Extension { @@ -214,7 +214,7 @@ La registramos usando [configuration|configuration#Latte]: ```neon latte: extensions: - - App\Templating\LatteExtension + - App\UI\Accessory\LatteExtension ``` diff --git a/application/fr/routing.texy b/application/fr/routing.texy index 9fe5d5e4a6..60cd583ce9 100644 --- a/application/fr/routing.texy +++ b/application/fr/routing.texy @@ -477,10 +477,10 @@ $router->addRoute('index', /* ... */); Intégration .[#toc-integration] =============================== -Afin de connecter notre routeur à l'application, nous devons en informer le conteneur DI. Le moyen le plus simple est de préparer la fabrique qui construira l'objet routeur et de dire à la configuration du conteneur de l'utiliser. Disons que nous écrivons une méthode dans ce but `App\Router\RouterFactory::createRouter()`: +Afin de connecter notre routeur à l'application, nous devons en informer le conteneur DI. Le moyen le plus simple est de préparer la fabrique qui construira l'objet routeur et de dire à la configuration du conteneur de l'utiliser. Disons que nous écrivons une méthode dans ce but `App\Core\RouterFactory::createRouter()`: ```php -namespace App\Router; +namespace App\Core use Nette\Application\Routers\RouteList; @@ -499,7 +499,7 @@ Puis nous écrivons dans la [configuration |dependency-injection:services]: ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter ``` Toutes les dépendances, telles qu'une connexion à une base de données, etc., sont transmises à la méthode factory en tant que paramètres en utilisant le [câblage automatique |dependency-injection:autowiring]: @@ -663,7 +663,7 @@ Par utilisation séparée, nous entendons l'utilisation des capacités du routeu Donc encore une fois nous allons créer une méthode qui va construire un routeur, par exemple : ```php -namespace App\Router; +namespace App\Core; use Nette\Routing\RouteList; @@ -694,7 +694,7 @@ $httpRequest = $container->getByType(Nette\Http\IRequest::class); Ou bien nous créerons directement des objets : ```php -$router = App\Router\RouterFactory::createRouter(); +$router = App\Core\RouterFactory::createRouter(); $httpRequest = (new Nette\Http\RequestFactory)->fromGlobals(); ``` diff --git a/application/fr/templates.texy b/application/fr/templates.texy index 8ecd733495..523d4a66e9 100644 --- a/application/fr/templates.texy +++ b/application/fr/templates.texy @@ -104,7 +104,7 @@ L'annotation `@property-read` est pour les IDE et l'analyse statique, elle fera Vous pouvez aussi vous offrir le luxe de chuchoter dans les templates, il suffit d'installer le plugin Latte dans PhpStorm et de spécifier le nom de la classe au début du template, voir l'article "Latte : how to type system":https://blog.nette.org/fr/latte-comment-utiliser-le-systeme-de-type: ```latte -{templateType App\Presenters\ArticleTemplate} +{templateType App\UI\Article\ArticleTemplate} ... ``` @@ -176,7 +176,7 @@ public function beforeRender(): void Latte version 3 propose un moyen plus avancé en créant une [extension |latte:creating-extension] pour chaque projet web. Voici un exemple approximatif d'une telle classe : ```php -namespace App\Templating; +namespace App\UI\Accessory; final class LatteExtension extends Latte\Extension { @@ -214,7 +214,7 @@ Nous l'enregistrons en utilisant la [configuration |configuration#Latte]: ```neon latte: extensions: - - App\Templating\LatteExtension + - App\UI\Accessory\LatteExtension ``` diff --git a/application/hu/routing.texy b/application/hu/routing.texy index 5cf399296b..5a230d8415 100644 --- a/application/hu/routing.texy +++ b/application/hu/routing.texy @@ -477,10 +477,10 @@ $router->addRoute('index', /* ... */); Integráció .[#toc-integration] ============================== -Ahhoz, hogy a routerünket az alkalmazásba kapcsoljuk, tájékoztatnunk kell róla a DI konténert. A legegyszerűbb, ha elkészítjük a gyárat, amely a router objektumot fogja felépíteni, és megmondjuk a konténer konfigurációjának, hogy használja azt. Tegyük fel, hogy írunk egy metódust erre a célra `App\Router\RouterFactory::createRouter()`: +Ahhoz, hogy a routerünket az alkalmazásba kapcsoljuk, tájékoztatnunk kell róla a DI konténert. A legegyszerűbb, ha elkészítjük a gyárat, amely a router objektumot fogja felépíteni, és megmondjuk a konténer konfigurációjának, hogy használja azt. Tegyük fel, hogy írunk egy metódust erre a célra `App\Core\RouterFactory::createRouter()`: ```php -namespace App\Router; +namespace App\Core use Nette\Application\Routers\RouteList; @@ -499,7 +499,7 @@ Ezután beírjuk a [konfigurációba |dependency-injection:services]: ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter ``` Az esetleges függőségeket, például az adatbázis-kapcsolatot stb., az [autowiring |dependency-injection:autowiring] segítségével paraméterként átadjuk a gyári metódusnak: @@ -663,7 +663,7 @@ A szeparált használat alatt a router képességeinek olyan alkalmazásban tör Tehát ismét létrehozunk egy metódust, amely létrehoz egy útválasztót, például: ```php -namespace App\Router; +namespace App\Core; use Nette\Routing\RouteList; @@ -694,7 +694,7 @@ $httpRequest = $container->getByType(Nette\Http\IRequest::class); Vagy közvetlenül hozzuk létre az objektumokat: ```php -$router = App\Router\RouterFactory::createRouter(); +$router = App\Core\RouterFactory::createRouter(); $httpRequest = (new Nette\Http\RequestFactory)->fromGlobals(); ``` diff --git a/application/hu/templates.texy b/application/hu/templates.texy index 71b205b7d1..280a242d37 100644 --- a/application/hu/templates.texy +++ b/application/hu/templates.texy @@ -104,7 +104,7 @@ A `@property-read` annotáció az IDE és a statikus elemzés számára készül A sablonokban is megengedheted magadnak a suttogás luxusát, csak telepítsd a Latte plugint a PhpStormban, és add meg az osztály nevét a sablon elején, lásd a "Latte: hogyan kell tipizálni a rendszert":https://blog.nette.org/hu/latte-hogyan-kell-hasznalni-a-tipusrendszert című cikket: ```latte -{templateType App\Presenters\ArticleTemplate} +{templateType App\UI\Article\ArticleTemplate} ... ``` @@ -176,7 +176,7 @@ public function beforeRender(): void A Latte 3. verziója egy fejlettebb módszert kínál, amely minden egyes webes projekthez egy [bővítményt |latte:creating-extension] hoz létre. Íme egy durva példa egy ilyen osztályra: ```php -namespace App\Templating; +namespace App\UI\Accessory; final class LatteExtension extends Latte\Extension { @@ -214,7 +214,7 @@ A [configuration |configuration#Latte] segítségével regisztráljuk: ```neon latte: extensions: - - App\Templating\LatteExtension + - App\UI\Accessory\LatteExtension ``` diff --git a/application/it/routing.texy b/application/it/routing.texy index c01d4ac823..96858ebe8c 100644 --- a/application/it/routing.texy +++ b/application/it/routing.texy @@ -477,10 +477,10 @@ $router->addRoute('index', /* ... */); Integrazione .[#toc-integration] ================================ -Per collegare il nostro router all'applicazione, dobbiamo comunicarlo al contenitore DI. Il modo più semplice è preparare il factory che costruirà l'oggetto router e dire al contenitore di configurazione di usarlo. Diciamo quindi di scrivere un metodo a questo scopo `App\Router\RouterFactory::createRouter()`: +Per collegare il nostro router all'applicazione, dobbiamo comunicarlo al contenitore DI. Il modo più semplice è preparare il factory che costruirà l'oggetto router e dire al contenitore di configurazione di usarlo. Diciamo quindi di scrivere un metodo a questo scopo `App\Core\RouterFactory::createRouter()`: ```php -namespace App\Router; +namespace App\Core use Nette\Application\Routers\RouteList; @@ -499,7 +499,7 @@ Poi scriviamo nella [configurazione |dependency-injection:services]: ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter ``` Tutte le dipendenze, come la connessione al database, ecc. vengono passate al metodo factory come parametri, utilizzando l'[autowiring |dependency-injection:autowiring]: @@ -663,7 +663,7 @@ Per uso separato si intende l'uso delle funzionalità del router in un'applicazi Quindi creeremo di nuovo un metodo che costruirà un router, ad esempio: ```php -namespace App\Router; +namespace App\Core; use Nette\Routing\RouteList; @@ -694,7 +694,7 @@ $httpRequest = $container->getByType(Nette\Http\IRequest::class); Oppure creeremo direttamente gli oggetti: ```php -$router = App\Router\RouterFactory::createRouter(); +$router = App\Core\RouterFactory::createRouter(); $httpRequest = (new Nette\Http\RequestFactory)->fromGlobals(); ``` diff --git a/application/it/templates.texy b/application/it/templates.texy index bb704a88f2..1f37541a8c 100644 --- a/application/it/templates.texy +++ b/application/it/templates.texy @@ -104,7 +104,7 @@ L'annotazione `@property-read` è per l'IDE e l'analisi statica, farà funzionar Ci si può concedere il lusso di sussurrare anche nei template, basta installare il plugin Latte in PhpStorm e specificare il nome della classe all'inizio del template, si veda l'articolo "Latte: come digitare il sistema":https://blog.nette.org/it/latte-come-usare-il-sistema-di-tipi: ```latte -{templateType App\Presenters\ArticleTemplate} +{templateType App\UI\Article\ArticleTemplate} ... ``` @@ -176,7 +176,7 @@ public function beforeRender(): void La versione 3 di Latte offre un metodo più avanzato, creando un'[estensione |latte:creating-extension] per ogni progetto web. Ecco un esempio approssimativo di una classe di questo tipo: ```php -namespace App\Templating; +namespace App\UI\Accessory; final class LatteExtension extends Latte\Extension { @@ -214,7 +214,7 @@ La registriamo usando [configuration |configuration#Latte]: ```neon latte: extensions: - - App\Templating\LatteExtension + - App\UI\Accessory\LatteExtension ``` diff --git a/application/pl/routing.texy b/application/pl/routing.texy index 4ce1af8644..2030924846 100644 --- a/application/pl/routing.texy +++ b/application/pl/routing.texy @@ -477,10 +477,10 @@ $router->addRoute('index', /* ... */); Integracja aplikacji .[#toc-integration] ======================================== -Aby zintegrować stworzony router z aplikacją, musimy powiedzieć o nim kontenerowi DI. Najprostszym sposobem na to jest przygotowanie fabryki tworzącej obiekt routera i powiedzenie konfiguracji kontenera, aby go użyć. Załóżmy, że w tym celu napiszemy metodę `App\Router\RouterFactory::createRouter()`: +Aby zintegrować stworzony router z aplikacją, musimy powiedzieć o nim kontenerowi DI. Najprostszym sposobem na to jest przygotowanie fabryki tworzącej obiekt routera i powiedzenie konfiguracji kontenera, aby go użyć. Załóżmy, że w tym celu napiszemy metodę `App\Core\RouterFactory::createRouter()`: ```php -namespace App\Router; +namespace App\Core use Nette\Application\Routers\RouteList; @@ -499,7 +499,7 @@ Następnie wpisujemy do [konfiguracji |dependency-injection:services]: ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter ``` Wszelkie zależności, na przykład od bazy danych itp, są przekazywane do metody fabrycznej jako jej parametry przez [autowiring |dependency-injection:autowiring]: @@ -663,7 +663,7 @@ Przez użycie samodzielne rozumiemy wykorzystanie możliwości routera w aplikac Czyli znowu tworzymy metodę, która buduje dla nas np. router: ```php -namespace App\Router; +namespace App\Core; use Nette\Routing\RouteList; @@ -694,7 +694,7 @@ $httpRequest = $container->getByType(Nette\Http\IRequest::class); Możemy też wykonać obiekty bezpośrednio: ```php -$router = App\Router\RouterFactory::createRouter(); +$router = App\Core\RouterFactory::createRouter(); $httpRequest = (new Nette\Http\RequestFactory)->fromGlobals(); ``` diff --git a/application/pl/templates.texy b/application/pl/templates.texy index a7dd044914..b348a3c8fd 100644 --- a/application/pl/templates.texy +++ b/application/pl/templates.texy @@ -104,7 +104,7 @@ Adnotacja `@property-read` jest dla IDE i analizy statycznej, sprawi, że szepta Możesz również mieć luksus szeptania w szablonach, wystarczy zainstalować wtyczkę Latte w PhpStorm i umieścić nazwę klasy na początku szablonu, zobacz artykuł "Latte: jak wpisać system":https://blog.nette.org/pl/latte-jak-korzystac-z-systemu-typow, aby uzyskać więcej informacji: ```latte -{templateType App\Presenters\ArticleTemplate} +{templateType App\UI\Article\ArticleTemplate} ... ``` @@ -176,7 +176,7 @@ public function beforeRender(): void Latte w wersji 3 oferuje bardziej zaawansowany sposób tworzenia [rozszerzenia |latte:creating-extension] dla każdego projektu internetowego. Oto krótki przykład takiej klasy: ```php -namespace App\Templating; +namespace App\UI\Accessory; final class LatteExtension extends Latte\Extension { @@ -214,7 +214,7 @@ Rejestrujemy go za pomocą [konfiguracji |configuration#Latte]: ```neon latte: extensions: - - App\Templating\LatteExtension + - App\UI\Accessory\LatteExtension ``` diff --git a/application/pt/routing.texy b/application/pt/routing.texy index 6caf887e2d..353f0c6220 100644 --- a/application/pt/routing.texy +++ b/application/pt/routing.texy @@ -477,10 +477,10 @@ $router->addRoute('index', /* ... */); Integração .[#toc-integration] ============================== -A fim de conectar nosso roteador à aplicação, devemos informar o recipiente DI sobre isso. A maneira mais fácil é preparar a fábrica que irá construir o objeto roteador e dizer à configuração do contêiner para usá-lo. Portanto, digamos que escrevemos um método para este fim `App\Router\RouterFactory::createRouter()`: +A fim de conectar nosso roteador à aplicação, devemos informar o recipiente DI sobre isso. A maneira mais fácil é preparar a fábrica que irá construir o objeto roteador e dizer à configuração do contêiner para usá-lo. Portanto, digamos que escrevemos um método para este fim `App\Core\RouterFactory::createRouter()`: ```php -namespace App\Router; +namespace App\Core use Nette\Application\Routers\RouteList; @@ -499,7 +499,7 @@ Em seguida, escrevemos em [configuração |dependency-injection:services]: ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter ``` Quaisquer dependências, tais como uma conexão de banco de dados, etc., são passadas para o método de fábrica como seus parâmetros usando [a fiação automática |dependency-injection:autowiring]: @@ -663,7 +663,7 @@ Por uso separado, entendemos o uso das capacidades do roteador em uma aplicaçã Assim, mais uma vez, criaremos um método que construirá um roteador, por exemplo: ```php -namespace App\Router; +namespace App\Core; use Nette\Routing\RouteList; @@ -694,7 +694,7 @@ $httpRequest = $container->getByType(Nette\Http\IRequest::class); Ou criaremos objetos diretamente: ```php -$router = App\Router\RouterFactory::createRouter(); +$router = App\Core\RouterFactory::createRouter(); $httpRequest = (new Nette\Http\RequestFactory)->fromGlobals(); ``` diff --git a/application/pt/templates.texy b/application/pt/templates.texy index 059e35178e..6c12049dbd 100644 --- a/application/pt/templates.texy +++ b/application/pt/templates.texy @@ -104,7 +104,7 @@ A anotação `@property-read` é para IDE e análise estática, fará com que o Você também pode se dar ao luxo de sussurrar nos modelos, basta instalar o plugin Latte no PhpStorm e especificar o nome da classe no início do modelo, veja o artigo "Latte: como digitar sistema":https://blog.nette.org/pt/latte-como-usar-o-sistema-de-tipo: ```latte -{templateType App\Presenters\ArticleTemplate} +{templateType App\UI\Article\ArticleTemplate} ... ``` @@ -176,7 +176,7 @@ public function beforeRender(): void A versão 3 do Latte oferece uma maneira mais avançada, criando uma [extensão |latte:creating-extension] para cada projeto web. Aqui está um exemplo rudimentar de tal classe: ```php -namespace App\Templating; +namespace App\UI\Accessory; final class LatteExtension extends Latte\Extension { @@ -214,7 +214,7 @@ Registramos usando [a configuração#Latte |configuration#Latte]: ```neon latte: extensions: - - App\Templating\LatteExtension + - App\UI\Accessory\LatteExtension ``` diff --git a/application/ro/routing.texy b/application/ro/routing.texy index 4f80ca99be..9a33c4b482 100644 --- a/application/ro/routing.texy +++ b/application/ro/routing.texy @@ -477,10 +477,10 @@ $router->addRoute('index', /* ... */); Integrare .[#toc-integration] ============================= -Pentru a conecta routerul nostru la aplicație, trebuie să informăm containerul DI despre acesta. Cel mai simplu este să pregătim fabrica care va construi obiectul router și să spunem configurației containerului să o folosească. Să spunem că scriem o metodă în acest scop `App\Router\RouterFactory::createRouter()`: +Pentru a conecta routerul nostru la aplicație, trebuie să informăm containerul DI despre acesta. Cel mai simplu este să pregătim fabrica care va construi obiectul router și să spunem configurației containerului să o folosească. Să spunem că scriem o metodă în acest scop `App\Core\RouterFactory::createRouter()`: ```php -namespace App\Router; +namespace App\Core use Nette\Application\Routers\RouteList; @@ -499,7 +499,7 @@ Apoi scriem în [configurație |dependency-injection:services]: ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter ``` Orice dependență, cum ar fi o conexiune la o bază de date etc., este transmisă metodei factory ca parametru al acesteia folosind [autowiring |dependency-injection:autowiring]: @@ -663,7 +663,7 @@ Prin utilizare separată se înțelege utilizarea capacităților routerului în Deci, din nou, vom crea o metodă care va construi un router, de exemplu: ```php -namespace App\Router; +namespace App\Core; use Nette\Routing\RouteList; @@ -694,7 +694,7 @@ $httpRequest = $container->getByType(Nette\Http\IRequest::class); Sau vom crea obiecte direct: ```php -$router = App\Router\RouterFactory::createRouter(); +$router = App\Core\RouterFactory::createRouter(); $httpRequest = (new Nette\Http\RequestFactory)->fromGlobals(); ``` diff --git a/application/ro/templates.texy b/application/ro/templates.texy index abcead647e..79f6f4de2a 100644 --- a/application/ro/templates.texy +++ b/application/ro/templates.texy @@ -104,7 +104,7 @@ Adnotarea `@property-read` este pentru IDE și analiza statică, va face ca auto Vă puteți permite și luxul de a șopti în șabloane, trebuie doar să instalați pluginul în PhpStorm și să specificați numele clasei la începutul șablonului, consultați articolul "Latte: cum se tastează sistemul":https://blog.nette.org/ro/latte-cum-se-utilizeaza-sistemul-de-tipuri: ```latte -{templateType App\Presenters\ArticleTemplate} +{templateType App\UI\Article\ArticleTemplate} ... ``` @@ -176,7 +176,7 @@ public function beforeRender(): void Latte versiunea 3 oferă o metodă mai avansată prin crearea unei [extensii |latte:creating-extension] pentru fiecare proiect web. Iată un exemplu aproximativ al unei astfel de clase: ```php -namespace App\Templating; +namespace App\UI\Accessory; final class LatteExtension extends Latte\Extension { @@ -214,7 +214,7 @@ O înregistrăm folosind [configuration#Latte]: ```neon latte: extensions: - - App\Templating\LatteExtension + - App\UI\Accessory\LatteExtension ``` diff --git a/application/ru/routing.texy b/application/ru/routing.texy index dd37c4fd4d..1ddd9ecf25 100644 --- a/application/ru/routing.texy +++ b/application/ru/routing.texy @@ -477,10 +477,10 @@ $router->addRoute('index', /* ... */); Интеграция .[#toc-integration] ============================== -Чтобы подключить наш маршрутизатор к приложению, мы должны сообщить о нем контейнеру DI. Самый простой способ - это подготовить фабрику, которая будет создавать объект маршрутизатора, и сообщить конфигурации контейнера, чтобы она его использовала. Допустим, мы напишем для этого метод `App\Router\RouterFactory::createRouter()`: +Чтобы подключить наш маршрутизатор к приложению, мы должны сообщить о нем контейнеру DI. Самый простой способ - это подготовить фабрику, которая будет создавать объект маршрутизатора, и сообщить конфигурации контейнера, чтобы она его использовала. Допустим, мы напишем для этого метод `App\Core\RouterFactory::createRouter()`: ```php -namespace App\Router; +namespace App\Core use Nette\Application\Routers\RouteList; @@ -499,7 +499,7 @@ class RouterFactory ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter ``` Любые зависимости, такие как подключение к базе данных и т.д., передаются методу фабрики в качестве параметров с помощью [autowiring |dependency-injection:autowiring]: @@ -663,7 +663,7 @@ $router->addRoute(/* ... */); Итак, мы снова добавим метод, который будет создавать, например, маршрутизатор: ```php -namespace App\Router; +namespace App\Core; use Nette\Routing\RouteList; @@ -694,7 +694,7 @@ $httpRequest = $container->getByType(Nette\Http\IRequest::class); Или мы будем создавать объекты напрямую: ```php -$router = App\Router\RouterFactory::createRouter(); +$router = App\Core\RouterFactory::createRouter(); $httpRequest = (new Nette\Http\RequestFactory)->fromGlobals(); ``` diff --git a/application/ru/templates.texy b/application/ru/templates.texy index 75f2c784d0..98dbd65152 100644 --- a/application/ru/templates.texy +++ b/application/ru/templates.texy @@ -104,7 +104,7 @@ class ArticleTemplate extends Nette\Bridges\ApplicationLatte\Template Вы также можете позволить себе роскошь шептать в шаблонах, просто установите плагин Latte в PhpStorm и поместите имя класса в начало шаблона, более подробную информацию смотрите в статье "Latte: как набирать систему":https://blog.nette.org/ru/latte-kak-ispol-zovat-sistemu-tipov: ```latte -{templateType App\Presenters\ArticleTemplate} +{templateType App\UI\Article\ArticleTemplate} ... ``` @@ -176,7 +176,7 @@ public function beforeRender(): void Latte версии 3 предлагает более продвинутый способ создания [расширения |latte:creating-extension] для каждого веб-проекта. Вот краткий пример такого класса: ```php -namespace App\Templating; +namespace App\UI\Accessory; final class LatteExtension extends Latte\Extension { @@ -214,7 +214,7 @@ final class LatteExtension extends Latte\Extension ```neon latte: extensions: - - App\Templating\LatteExtension + - App\UI\Accessory\LatteExtension ``` diff --git a/application/sl/routing.texy b/application/sl/routing.texy index 0f717178bb..8617fe98d6 100644 --- a/application/sl/routing.texy +++ b/application/sl/routing.texy @@ -477,10 +477,10 @@ $router->addRoute('index', /* ... */); Integracija .[#toc-integration] =============================== -Da bi naš usmerjevalnik povezali z aplikacijo, moramo o tem obvestiti vsebnik DI. Najlažje je pripraviti tovarno, ki bo zgradila objekt usmerjevalnika, in povedati konfiguraciji vsebnika, naj jo uporabi. Recimo, da v ta namen napišemo metodo `App\Router\RouterFactory::createRouter()`: +Da bi naš usmerjevalnik povezali z aplikacijo, moramo o tem obvestiti vsebnik DI. Najlažje je pripraviti tovarno, ki bo zgradila objekt usmerjevalnika, in povedati konfiguraciji vsebnika, naj jo uporabi. Recimo, da v ta namen napišemo metodo `App\Core\RouterFactory::createRouter()`: ```php -namespace App\Router; +namespace App\Core use Nette\Application\Routers\RouteList; @@ -499,7 +499,7 @@ Nato zapišemo v [konfiguracijo |dependency-injection:services]: ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter ``` Vse odvisnosti, kot je povezava s podatkovno bazo itd., se metodi tovarne posredujejo kot njeni parametri z uporabo [samodejnega povezovanja |dependency-injection:autowiring]: @@ -663,7 +663,7 @@ Z ločeno uporabo mislimo na uporabo zmožnosti usmerjevalnika v aplikaciji, ki Tako bomo ponovno ustvarili metodo, ki bo zgradila usmerjevalnik, na primer: ```php -namespace App\Router; +namespace App\Core; use Nette\Routing\RouteList; @@ -694,7 +694,7 @@ $httpRequest = $container->getByType(Nette\Http\IRequest::class); Ali pa bomo predmete ustvarili neposredno: ```php -$router = App\Router\RouterFactory::createRouter(); +$router = App\Core\RouterFactory::createRouter(); $httpRequest = (new Nette\Http\RequestFactory)->fromGlobals(); ``` diff --git a/application/sl/templates.texy b/application/sl/templates.texy index 66005783a9..e182bf4118 100644 --- a/application/sl/templates.texy +++ b/application/sl/templates.texy @@ -104,7 +104,7 @@ Opomba `@property-read` je namenjena IDE in statični analizi, zaradi nje bo del Privoščite si lahko tudi razkošje šepetanja v predlogah, samo namestite vtičnik Latte v PhpStorm in na začetku predloge navedite ime razreda, glejte članek "Latte: kako vtipkati sistem":https://blog.nette.org/sl/latte-kako-uporabljati-sistem-tipov: ```latte -{templateType App\Presenters\ArticleTemplate} +{templateType App\UI\Article\ArticleTemplate} ... ``` @@ -176,7 +176,7 @@ public function beforeRender(): void Različica Latte 3 ponuja naprednejši način z ustvarjanjem [razširitve |latte:creating-extension] za vsak spletni projekt. Tukaj je približni primer takega razreda: ```php -namespace App\Templating; +namespace App\UI\Accessory; final class LatteExtension extends Latte\Extension { @@ -214,7 +214,7 @@ Registriramo ga z uporabo [konfiguracije|configuration#Latte]: ```neon latte: extensions: - - App\Templating\LatteExtension + - App\UI\Accessory\LatteExtension ``` diff --git a/application/tr/routing.texy b/application/tr/routing.texy index cbd1656234..29c7887f19 100644 --- a/application/tr/routing.texy +++ b/application/tr/routing.texy @@ -477,10 +477,10 @@ $router->addRoute('index', /* ... */); Entegrasyon .[#toc-integration] =============================== -Yönlendiricimizi uygulamaya bağlamak için DI konteynerine bunu söylemeliyiz. Bunun en kolay yolu router nesnesini oluşturacak fabrikayı hazırlamak ve container konfigürasyonuna bunu kullanmasını söylemektir. Diyelim ki bu amaçla bir metot yazdık `App\Router\RouterFactory::createRouter()`: +Yönlendiricimizi uygulamaya bağlamak için DI konteynerine bunu söylemeliyiz. Bunun en kolay yolu router nesnesini oluşturacak fabrikayı hazırlamak ve container konfigürasyonuna bunu kullanmasını söylemektir. Diyelim ki bu amaçla bir metot yazdık `App\Core\RouterFactory::createRouter()`: ```php -namespace App\Router; +namespace App\Core use Nette\Application\Routers\RouteList; @@ -499,7 +499,7 @@ Daha sonra [yapılandırmaya |dependency-injection:services] yazıyoruz: ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter ``` Veritabanı bağlantısı vb. gibi tüm bağımlılıklar, [otomatik |dependency-injection:autowiring] bağlantı kullanılarak fabrika yöntemine parametreleri olarak aktarılır: @@ -663,7 +663,7 @@ Ayrı kullanımla, yönlendiricinin yeteneklerinin Nette Uygulaması ve sunucula Bu yüzden yine örneğin bir yönlendirici oluşturacak bir yöntem oluşturacağız: ```php -namespace App\Router; +namespace App\Core; use Nette\Routing\RouteList; @@ -694,7 +694,7 @@ $httpRequest = $container->getByType(Nette\Http\IRequest::class); Ya da doğrudan nesneler oluşturacağız: ```php -$router = App\Router\RouterFactory::createRouter(); +$router = App\Core\RouterFactory::createRouter(); $httpRequest = (new Nette\Http\RequestFactory)->fromGlobals(); ``` diff --git a/application/tr/templates.texy b/application/tr/templates.texy index d817bc2d45..6d835f5bd4 100644 --- a/application/tr/templates.texy +++ b/application/tr/templates.texy @@ -104,7 +104,7 @@ Sunucudaki `$this->template` nesnesi artık `ArticleTemplate` sınıfının bir Şablonlarda da fısıldama lüksünün tadını çıkarabilirsiniz, sadece PhpStorm'da Latte eklentisini kurun ve şablonun başında sınıf adını belirtin, "Latte: sistem nasıl yazılır":https://blog.nette.org/tr/latte-tip-sistemi-nasil-kullanilir makalesine bakın: ```latte -{templateType App\Presenters\ArticleTemplate} +{templateType App\UI\Article\ArticleTemplate} ... ``` @@ -176,7 +176,7 @@ public function beforeRender(): void Latte sürüm 3, her web projesi için bir [uzantı |latte:creating-extension] oluşturarak daha gelişmiş bir yol sunar. İşte böyle bir sınıfın kabaca bir örneği: ```php -namespace App\Templating; +namespace App\UI\Accessory; final class LatteExtension extends Latte\Extension { @@ -214,7 +214,7 @@ final class LatteExtension extends Latte\Extension ```neon latte: extensions: - - App\Templating\LatteExtension + - App\UI\Accessory\LatteExtension ``` diff --git a/application/uk/routing.texy b/application/uk/routing.texy index c19046885b..93982b2dc3 100644 --- a/application/uk/routing.texy +++ b/application/uk/routing.texy @@ -477,10 +477,10 @@ $router->addRoute('index', /* ... */); Інтеграція .[#toc-integration] ============================== -Щоб підключити наш маршрутизатор до застосунку, ми повинні повідомити про нього контейнер DI. Найпростіший спосіб - це підготувати фабрику, яка буде створювати об'єкт маршрутизатора, і повідомити конфігурацію контейнера, щоб вона його використовувала. Припустимо, ми напишемо для цього метод `App\Router\RouterFactory::createRouter()`: +Щоб підключити наш маршрутизатор до застосунку, ми повинні повідомити про нього контейнер DI. Найпростіший спосіб - це підготувати фабрику, яка буде створювати об'єкт маршрутизатора, і повідомити конфігурацію контейнера, щоб вона його використовувала. Припустимо, ми напишемо для цього метод `App\Core\RouterFactory::createRouter()`: ```php -namespace App\Router; +namespace App\Core use Nette\Application\Routers\RouteList; @@ -499,7 +499,7 @@ class RouterFactory ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter ``` Будь-які залежності, такі як підключення до бази даних тощо, передаються методу фабрики як параметри за допомогою [autowiring |dependency-injection:autowiring]: @@ -663,7 +663,7 @@ $router->addRoute(/* ... */); Отже, ми знову додамо метод, який буде створювати, наприклад, маршрутизатор: ```php -namespace App\Router; +namespace App\Core; use Nette\Routing\RouteList; @@ -694,7 +694,7 @@ $httpRequest = $container->getByType(Nette\Http\IRequest::class); Або ми будемо створювати об'єкти безпосередньо: ```php -$router = App\Router\RouterFactory::createRouter(); +$router = App\Core\RouterFactory::createRouter(); $httpRequest = (new Nette\Http\RequestFactory)->fromGlobals(); ``` diff --git a/application/uk/templates.texy b/application/uk/templates.texy index 2dc5f8f053..5c01ae8a79 100644 --- a/application/uk/templates.texy +++ b/application/uk/templates.texy @@ -104,7 +104,7 @@ class ArticleTemplate extends Nette\Bridges\ApplicationLatte\Template Ви також можете дозволити собі розкіш шепотіти в шаблонах, просто встановіть плагін Latte в PhpStorm і помістіть ім'я класу на початок шаблону, докладнішу інформацію дивіться в статті "Latte: як набирати систему":https://blog.nette.org/uk/latte-yak-koristuvatisya-sistemoyu-tipiv: ```latte -{templateType App\Presenters\ArticleTemplate} +{templateType App\UI\Article\ArticleTemplate} ... ``` @@ -176,7 +176,7 @@ public function beforeRender(): void Latte версії 3 пропонує більш просунутий спосіб створення [розширення |latte:creating-extension] для кожного веб-проекту. Ось короткий приклад такого класу: ```php -namespace App\Templating; +namespace App\UI\Accessory; final class LatteExtension extends Latte\Extension { @@ -214,7 +214,7 @@ final class LatteExtension extends Latte\Extension ```neon latte: extensions: - - App\Templating\LatteExtension + - App\UI\Accessory\LatteExtension ``` diff --git a/best-practices/bg/composer.texy b/best-practices/bg/composer.texy index 13bf7df4cc..2852264f64 100644 --- a/best-practices/bg/composer.texy +++ b/best-practices/bg/composer.texy @@ -189,7 +189,7 @@ Packagist.org - глобално хранилище .[#toc-packagist-org-global- Впоследствие трябва да стартирате командата `composer dumpautoload` при всяка промяна и да позволите на таблиците на автоматичния модул да се възстановят. Това е изключително неудобно и е много по-добре да оставите тази задача на [RobotLoader |robot-loader:], който върши същата работа автоматично във фонов режим и много по-бързо. -Вторият вариант е да следвате [PSR-4 |https://www.php-fig.org/psr/psr-4/]. Казано по-просто, това е система, в която пространствата от имена и имената на класовете съответстват на структурата на директориите и имената на файловете, т.е. `App\Router\RouterFactory` се намира в `/path/to/App/Router/RouterFactory.php`. Примерна конфигурация: +Вторият вариант е да следвате [PSR-4 |https://www.php-fig.org/psr/psr-4/]. Казано по-просто, това е система, в която пространствата от имена и имената на класовете съответстват на структурата на директориите и имената на файловете, т.е. `App\Core\RouterFactory` се намира в `/path/to/App/Core/RouterFactory.php`. Примерна конфигурация: ```js { diff --git a/best-practices/bg/pagination.texy b/best-practices/bg/pagination.texy index 28256dd731..9d04ddc1b1 100644 --- a/best-practices/bg/pagination.texy +++ b/best-practices/bg/pagination.texy @@ -11,7 +11,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -34,7 +33,7 @@ class ArticleRepository След това въвеждаме класа на модела в презентатора и в метода `render` правим справка за публикуваните статии, които предаваме на шаблона: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -53,7 +52,7 @@ class HomePresenter extends Nette\Application\UI\Presenter } ``` -В шаблона се грижим за извеждането на списъка със статии: +След това шаблонът `default.latte` ще се погрижи за изброяването на статиите: ```latte {block content} @@ -114,7 +113,7 @@ class ArticleRepository Също така разширяваме метода `render`, за да получим инстанцията Paginator, да я конфигурираме и да изберем желаните статии, които да се показват в шаблона. HomePresenter ще изглежда по следния начин: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -190,7 +189,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -210,7 +208,7 @@ class ArticleRepository Не е необходимо да създаваме Paginator в презентатора, вместо това ще използваме метода на обекта `Selection`, върнат от хранилището: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; diff --git a/best-practices/cs/composer.texy b/best-practices/cs/composer.texy index 9ac10dc558..8ea7581472 100644 --- a/best-practices/cs/composer.texy +++ b/best-practices/cs/composer.texy @@ -189,7 +189,7 @@ Nicméně je možné používat Composer i pro načítání dalších tříd i m Následně je potřeba při každé změně spustit příkaz `composer dumpautoload` a nechat autoloadovací tabulky přegenerovat. To je nesmírně nepohodlné a daleko lepší je tento úkol svěřit [RobotLoaderu|robot-loader:], který stejnou činnost provádí automaticky na pozadí a mnohem rychleji. -Druhou možností je dodržovat [PSR-4|https://www.php-fig.org/psr/psr-4/]. Zjednodušeně řečeno jde o systém, kdy jmenné prostory a názvy tříd odpovídají adresářové struktuře a názvům souborů, tedy např. `App\Router\RouterFactory` bude v souboru `/path/to/App/Router/RouterFactory.php`. Příklad konfigurace: +Druhou možností je dodržovat [PSR-4|https://www.php-fig.org/psr/psr-4/]. Zjednodušeně řečeno jde o systém, kdy jmenné prostory a názvy tříd odpovídají adresářové struktuře a názvům souborů, tedy např. `App\Core\RouterFactory` bude v souboru `/path/to/App/Core/RouterFactory.php`. Příklad konfigurace: ```js { diff --git a/best-practices/cs/pagination.texy b/best-practices/cs/pagination.texy index bf7d18a418..8a558bb0b7 100644 --- a/best-practices/cs/pagination.texy +++ b/best-practices/cs/pagination.texy @@ -11,7 +11,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -34,7 +33,7 @@ class ArticleRepository V presenteru si pak injectujeme modelovou třídu a v render metodě si vyžádáme publikované články, které předáme do šablony: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -53,7 +52,7 @@ class HomePresenter extends Nette\Application\UI\Presenter } ``` -V šabloně se pak postaráme o výpis článků: +V šabloně `default.latte` se pak postaráme o výpis článků: ```latte {block content} @@ -114,7 +113,7 @@ Následně se pustíme do úprav presenteru. Do render metody budeme předávat Dále také render metodu rozšíříme o získání instance Paginatoru, jeho nastavení a výběru správných článků pro zobrazení v šabloně. HomePresenter bude po úpravách vypadat takto: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -190,7 +189,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -210,7 +208,7 @@ class ArticleRepository V presenteru nemusíme vytvářet Paginator, použijeme místo něj metodu třídy `Selection`, kterou nám vrací repositář: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; diff --git a/best-practices/de/composer.texy b/best-practices/de/composer.texy index 8910b9e603..10aed8c202 100644 --- a/best-practices/de/composer.texy +++ b/best-practices/de/composer.texy @@ -189,7 +189,7 @@ Es ist jedoch auch möglich, Composer zu verwenden, um andere Klassen außerhalb Anschließend müssen Sie bei jeder Änderung den Befehl `composer dumpautoload` ausführen und die Autoloader-Tabellen neu generieren lassen. Dies ist äußerst lästig, und es ist weitaus besser, diese Aufgabe [RobotLoader |robot-loader:] anzuvertrauen, der dieselbe Tätigkeit automatisch im Hintergrund und viel schneller durchführt. -Die zweite Möglichkeit ist, [PSR-4 |https://www.php-fig.org/psr/psr-4/] zu folgen. Einfach gesagt handelt es sich um ein System, bei dem die Namensräume und Klassennamen der Verzeichnisstruktur und den Dateinamen entsprechen, d. h. `App\Router\RouterFactory` befindet sich in der Datei `/path/to/App/Router/RouterFactory.php`. Beispiel für eine Konfiguration: +Die zweite Möglichkeit ist, [PSR-4 |https://www.php-fig.org/psr/psr-4/] zu folgen. Einfach gesagt handelt es sich um ein System, bei dem die Namensräume und Klassennamen der Verzeichnisstruktur und den Dateinamen entsprechen, d. h. `App\Core\RouterFactory` befindet sich in der Datei `/path/to/App/Core/RouterFactory.php`. Beispiel für eine Konfiguration: ```js { diff --git a/best-practices/de/pagination.texy b/best-practices/de/pagination.texy index ef5a0920ad..245680368c 100644 --- a/best-practices/de/pagination.texy +++ b/best-practices/de/pagination.texy @@ -11,7 +11,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -34,7 +33,7 @@ class ArticleRepository In den Presenter injizieren wir dann die Modellklasse, und in der Rendering-Methode fragen wir nach den veröffentlichten Artikeln, die wir an die Vorlage übergeben: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -53,7 +52,7 @@ class HomePresenter extends Nette\Application\UI\Presenter } ``` -In der Vorlage kümmern wir uns um das Rendern einer Artikelliste: +Die Vorlage `default.latte` kümmert sich dann um die Auflistung der Artikel: ```latte {block content} @@ -114,7 +113,7 @@ Der nächste Schritt besteht darin, den Präsentator zu bearbeiten. Wir werden d Wir erweitern die Render-Methode auch, um die Paginator-Instanz zu erhalten, sie einzurichten und die richtigen Artikel für die Anzeige in der Vorlage auszuwählen. Der HomePresenter wird wie folgt aussehen: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -190,7 +189,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -210,7 +208,7 @@ class ArticleRepository Wir müssen keinen Paginator im Presenter erstellen, sondern verwenden die Methode des `Selection` -Objekts, das vom Repository zurückgegeben wird: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; diff --git a/best-practices/el/composer.texy b/best-practices/el/composer.texy index 410b88c45a..75f9e3f0bc 100644 --- a/best-practices/el/composer.texy +++ b/best-practices/el/composer.texy @@ -189,7 +189,7 @@ Packagist.org - Παγκόσμιο αποθετήριο .[#toc-packagist-org-glo Στη συνέχεια, είναι απαραίτητο να εκτελείτε την εντολή `composer dumpautoload` με κάθε αλλαγή και να αφήνετε τους πίνακες αυτόματης φόρτωσης να αναγεννώνται. Αυτό είναι εξαιρετικά άβολο και είναι πολύ καλύτερο να αναθέσετε αυτή την εργασία στο [RobotLoader |robot-loader:], το οποίο εκτελεί την ίδια δραστηριότητα αυτόματα στο παρασκήνιο και πολύ πιο γρήγορα. -Η δεύτερη επιλογή είναι να ακολουθήσετε το [PSR-4 |https://www.php-fig.org/psr/psr-4/]. Με απλά λόγια, πρόκειται για ένα σύστημα όπου τα namespaces και τα ονόματα των κλάσεων αντιστοιχούν στη δομή των καταλόγων και των ονομάτων των αρχείων, δηλαδή το `App\Router\RouterFactory` βρίσκεται στο αρχείο `/path/to/App/Router/RouterFactory.php`. Παράδειγμα διαμόρφωσης: +Η δεύτερη επιλογή είναι να ακολουθήσετε το [PSR-4 |https://www.php-fig.org/psr/psr-4/]. Με απλά λόγια, πρόκειται για ένα σύστημα όπου τα namespaces και τα ονόματα των κλάσεων αντιστοιχούν στη δομή των καταλόγων και των ονομάτων των αρχείων, δηλαδή το `App\Core\RouterFactory` βρίσκεται στο αρχείο `/path/to/App/Core/RouterFactory.php`. Παράδειγμα διαμόρφωσης: ```js { diff --git a/best-practices/el/pagination.texy b/best-practices/el/pagination.texy index 06fca7da8a..599f3ff25a 100644 --- a/best-practices/el/pagination.texy +++ b/best-practices/el/pagination.texy @@ -11,7 +11,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -34,7 +33,7 @@ class ArticleRepository Στον Presenter στη συνέχεια εισάγουμε την κλάση model και στη μέθοδο render θα ζητήσουμε τα δημοσιευμένα άρθρα που θα περάσουμε στο template: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -53,7 +52,7 @@ class HomePresenter extends Nette\Application\UI\Presenter } ``` -Στο πρότυπο, θα φροντίσουμε για την απόδοση μιας λίστας άρθρων: +Το πρότυπο `default.latte` θα αναλάβει στη συνέχεια την καταχώριση των άρθρων: ```latte {block content} @@ -114,7 +113,7 @@ class ArticleRepository Επεκτείνουμε επίσης τη μέθοδο render για να λάβουμε την περίπτωση Paginator, να τη ρυθμίσουμε και να επιλέξουμε τα σωστά άρθρα που θα εμφανίζονται στο πρότυπο. Το HomePresenter θα μοιάζει με αυτό: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -190,7 +189,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -210,7 +208,7 @@ class ArticleRepository Δεν χρειάζεται να δημιουργήσουμε Paginator στο Presenter, αντίθετα θα χρησιμοποιήσουμε τη μέθοδο του αντικειμένου `Selection` που επιστρέφεται από το αποθετήριο: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; diff --git a/best-practices/en/composer.texy b/best-practices/en/composer.texy index bc65bb1c55..d8753b98bd 100644 --- a/best-practices/en/composer.texy +++ b/best-practices/en/composer.texy @@ -189,7 +189,7 @@ However, it is also possible to use Composer to load other classes outside the f Subsequently, it is necessary to run the command `composer dumpautoload` with each change and let the autoloading tables regenerate. This is extremely inconvenient, and it is far better to entrust this task to [RobotLoader|robot-loader:], which performs the same activity automatically in the background and much faster. -The second option is to follow [PSR-4 |https://www.php-fig.org/psr/psr-4/]. Simply saying, it is a system where the namespaces and class names correspond to the directory structure and file names, ie `App\Router\RouterFactory` is located in the file `/path/to/App/Router/RouterFactory.php`. Configuration example: +The second option is to follow [PSR-4 |https://www.php-fig.org/psr/psr-4/]. Simply saying, it is a system where the namespaces and class names correspond to the directory structure and file names, ie `App\Core\RouterFactory` is located in the file `/path/to/App/Core/RouterFactory.php`. Configuration example: ```js { diff --git a/best-practices/en/pagination.texy b/best-practices/en/pagination.texy index 113ce80193..8fa2b98ace 100644 --- a/best-practices/en/pagination.texy +++ b/best-practices/en/pagination.texy @@ -11,7 +11,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -34,7 +33,7 @@ class ArticleRepository In the Presenter we then inject the model class and in the render method we will ask for the published articles that we pass to the template: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -53,7 +52,7 @@ class HomePresenter extends Nette\Application\UI\Presenter } ``` -In the template, we will take care of rendering an articles list: +The `default.latte` template will then take care of listing the articles: ```latte {block content} @@ -114,7 +113,7 @@ The next step is to edit the presenter. We will forward the number of the curren We also expand the render method to get the Paginator instance, setting it up, and selecting the correct articles to display in the template. HomePresenter will look like this: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -190,7 +189,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -210,7 +208,7 @@ class ArticleRepository We do not have to create Paginator in the Presenter, instead we will use the method of `Selection` object returned by the repository: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; diff --git a/best-practices/es/composer.texy b/best-practices/es/composer.texy index e9fd4a1bf3..86cf99808a 100644 --- a/best-practices/es/composer.texy +++ b/best-practices/es/composer.texy @@ -189,7 +189,7 @@ Sin embargo, también es posible utilizar Composer para cargar otras clases fuer Posteriormente, es necesario ejecutar el comando `composer dumpautoload` con cada cambio y dejar que se regeneren las tablas de autocarga. Esto es extremadamente incómodo, y es mucho mejor confiar esta tarea a [RobotLoader |robot-loader:], que realiza la misma actividad automáticamente en segundo plano y mucho más rápido. -La segunda opción es seguir [PSR-4 |https://www.php-fig.org/psr/psr-4/]. En pocas palabras, se trata de un sistema en el que los espacios de nombres y los nombres de las clases se corresponden con la estructura de directorios y los nombres de los archivos, es decir, `App\Router\RouterFactory` se encuentra en el archivo `/path/to/App/Router/RouterFactory.php`. Ejemplo de configuración: +La segunda opción es seguir [PSR-4 |https://www.php-fig.org/psr/psr-4/]. En pocas palabras, se trata de un sistema en el que los espacios de nombres y los nombres de las clases se corresponden con la estructura de directorios y los nombres de los archivos, es decir, `App\Core\RouterFactory` se encuentra en el archivo `/path/to/App/Core/RouterFactory.php`. Ejemplo de configuración: ```js { diff --git a/best-practices/es/pagination.texy b/best-practices/es/pagination.texy index 44d6fddd5f..287b5d17a3 100644 --- a/best-practices/es/pagination.texy +++ b/best-practices/es/pagination.texy @@ -11,7 +11,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -34,7 +33,7 @@ class ArticleRepository En el Presentador inyectamos entonces la clase modelo y en el método render pediremos los artículos publicados que pasamos al modelo: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -53,7 +52,7 @@ class HomePresenter extends Nette\Application\UI\Presenter } ``` -En la plantilla nos encargaremos de renderizar una lista de artículos: +La plantilla `default.latte` se encargará de listar los artículos: ```latte {block content} @@ -114,7 +113,7 @@ El siguiente paso es editar el presentador. Enviaremos el número de la página También expandimos el método render para obtener la instancia Paginator, configurándola, y seleccionando los artículos correctos para mostrar en la plantilla. HomePresenter tendrá este aspecto: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -190,7 +189,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -210,7 +208,7 @@ class ArticleRepository No tenemos que crear Paginator en el Presentador, en su lugar utilizaremos el método del objeto `Selection` devuelto por el repositorio: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; diff --git a/best-practices/fr/composer.texy b/best-practices/fr/composer.texy index d934b6499d..bb6de406f9 100644 --- a/best-practices/fr/composer.texy +++ b/best-practices/fr/composer.texy @@ -189,7 +189,7 @@ Toutefois, il est également possible d'utiliser Composer pour charger d'autres Par la suite, il est nécessaire d'exécuter la commande `composer dumpautoload` à chaque modification et de laisser les tables d'autoloadage se régénérer. Ceci est extrêmement gênant, et il est de loin préférable de confier cette tâche à [RobotLoader |robot-loader:], qui effectue la même activité automatiquement en arrière-plan et beaucoup plus rapidement. -La deuxième option consiste à suivre le [système PSR-4 |https://www.php-fig.org/psr/psr-4/]. Pour faire simple, il s'agit d'un système où les espaces de noms et les noms de classes correspondent à la structure des répertoires et aux noms de fichiers, c'est-à-dire que `App\Router\RouterFactory` est situé dans le fichier `/path/to/App/Router/RouterFactory.php`. Exemple de configuration : +La deuxième option consiste à suivre le [système PSR-4 |https://www.php-fig.org/psr/psr-4/]. Pour faire simple, il s'agit d'un système où les espaces de noms et les noms de classes correspondent à la structure des répertoires et aux noms de fichiers, c'est-à-dire que `App\Core\RouterFactory` est situé dans le fichier `/path/to/App/Core/RouterFactory.php`. Exemple de configuration : ```js { diff --git a/best-practices/fr/pagination.texy b/best-practices/fr/pagination.texy index cbd07b5ec6..cafbff84cc 100644 --- a/best-practices/fr/pagination.texy +++ b/best-practices/fr/pagination.texy @@ -11,7 +11,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -34,7 +33,7 @@ class ArticleRepository Dans le Presenter nous injectons ensuite la classe model et dans la méthode render nous allons demander les articles publiés que nous passons au template : ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -53,7 +52,7 @@ class HomePresenter extends Nette\Application\UI\Presenter } ``` -Dans le modèle, nous allons nous occuper de rendre une liste d'articles : +Le modèle `default.latte` se chargera ensuite de répertorier les articles : ```latte {block content} @@ -114,7 +113,7 @@ L'étape suivante consiste à modifier le présentateur. Nous allons transmettre Nous étendons également la méthode de rendu pour obtenir l'instance de Paginator, la configurer et sélectionner les bons articles à afficher dans le modèle. Le HomePresenter ressemblera à ceci : ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -190,7 +189,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -210,7 +208,7 @@ class ArticleRepository Nous n'avons pas besoin de créer le Paginator dans le Presenter, à la place nous utiliserons la méthode de l'objet `Selection` retourné par le référentiel : ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; diff --git a/best-practices/hu/composer.texy b/best-practices/hu/composer.texy index fee65b20c5..d3c767b633 100644 --- a/best-practices/hu/composer.texy +++ b/best-practices/hu/composer.texy @@ -189,7 +189,7 @@ Lehetőség van azonban arra is, hogy a Composer segítségével a `vendor` mapp Ezt követően minden egyes változtatásnál el kell indítani a `composer dumpautoload` parancsot, és hagyni kell, hogy az autoloading táblák újratermelődjenek. Ez rendkívül kényelmetlen, és sokkal jobb, ha ezt a feladatot a [RobotLoaderre |robot-loader:] bízzuk, amely a háttérben automatikusan és sokkal gyorsabban végzi el ugyanezt a tevékenységet. -A második lehetőség a [PSR-4 |https://www.php-fig.org/psr/psr-4/] követése. Egyszerűen fogalmazva, ez egy olyan rendszer, ahol a névterek és az osztálynevek megfelelnek a könyvtárszerkezetnek és a fájlneveknek, azaz a `App\Router\RouterFactory` a `/path/to/App/Router/RouterFactory.php` fájlban található. Konfigurációs példa: +A második lehetőség a [PSR-4 |https://www.php-fig.org/psr/psr-4/] követése. Egyszerűen fogalmazva, ez egy olyan rendszer, ahol a névterek és az osztálynevek megfelelnek a könyvtárszerkezetnek és a fájlneveknek, azaz a `App\Core\RouterFactory` a `/path/to/App/Core/RouterFactory.php` fájlban található. Konfigurációs példa: ```js { diff --git a/best-practices/hu/pagination.texy b/best-practices/hu/pagination.texy index e1805afd07..f9611c6e3f 100644 --- a/best-practices/hu/pagination.texy +++ b/best-practices/hu/pagination.texy @@ -11,7 +11,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -34,7 +33,7 @@ class ArticleRepository A Presenterben ezután befecskendezzük a modell osztályt, és a render metódusban lekérdezzük a publikált cikkeket, amelyeket átadunk a sablonhoz: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -53,7 +52,7 @@ class HomePresenter extends Nette\Application\UI\Presenter } ``` -A sablonban gondoskodunk egy cikklista rendereléséről: +A `default.latte` sablon ezután gondoskodik a cikkek felsorolásáról: ```latte {block content} @@ -114,7 +113,7 @@ A következő lépés a bemutató szerkesztése. Az aktuálisan megjelenített o A render metódust kibővítjük a Paginator példány megszerzésével, beállításával és a sablonban megjelenítendő megfelelő cikkek kiválasztásával is. A HomePresenter így fog kinézni: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -190,7 +189,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -210,7 +208,7 @@ class ArticleRepository Nem kell Paginátort létrehoznunk a Presenterben, helyette az adattár által visszaadott `Selection` objektum metódusát fogjuk használni: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; diff --git a/best-practices/it/composer.texy b/best-practices/it/composer.texy index 93f33e4133..6ca7aff82e 100644 --- a/best-practices/it/composer.texy +++ b/best-practices/it/composer.texy @@ -189,7 +189,7 @@ Tuttavia, è anche possibile usare Composer per caricare altre classi al di fuor Successivamente, è necessario eseguire il comando `composer dumpautoload` a ogni modifica e lasciare che le tabelle di autocaricamento si rigenerino. Questo è estremamente scomodo ed è molto meglio affidare questo compito a [RobotLoader |robot-loader:], che svolge la stessa attività automaticamente in background e molto più velocemente. -La seconda opzione consiste nel seguire [PSR-4 |https://www.php-fig.org/psr/psr-4/]. In parole povere, si tratta di un sistema in cui gli spazi dei nomi e i nomi delle classi corrispondono alla struttura delle directory e ai nomi dei file, cioè `App\Router\RouterFactory` si trova nel file `/path/to/App/Router/RouterFactory.php`. Esempio di configurazione: +La seconda opzione consiste nel seguire [PSR-4 |https://www.php-fig.org/psr/psr-4/]. In parole povere, si tratta di un sistema in cui gli spazi dei nomi e i nomi delle classi corrispondono alla struttura delle directory e ai nomi dei file, cioè `App\Core\RouterFactory` si trova nel file `/path/to/App/Core/RouterFactory.php`. Esempio di configurazione: ```js { diff --git a/best-practices/it/pagination.texy b/best-practices/it/pagination.texy index 0d6ca96483..adf166b262 100644 --- a/best-practices/it/pagination.texy +++ b/best-practices/it/pagination.texy @@ -11,7 +11,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -34,7 +33,7 @@ class ArticleRepository Nel Presenter iniettiamo poi la classe Model e nel metodo render chiediamo gli articoli pubblicati che passiamo al template: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -53,7 +52,7 @@ class HomePresenter extends Nette\Application\UI\Presenter } ``` -Nel modello, ci occuperemo di rendere un elenco di articoli: +Il modello `default.latte` si occuperà di elencare gli articoli: ```latte {block content} @@ -114,7 +113,7 @@ Il passo successivo è modificare il presentatore. Inoltreremo il numero della p Espandiamo inoltre il metodo render per ottenere l'istanza di Paginator, impostandola e selezionando gli articoli corretti da visualizzare nel template. HomePresenter avrà questo aspetto: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -190,7 +189,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -210,7 +208,7 @@ class ArticleRepository Non è necessario creare il Paginator nel Presenter, ma si utilizzerà il metodo dell'oggetto `Selection` restituito dal repository: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; diff --git a/best-practices/pl/composer.texy b/best-practices/pl/composer.texy index 125441e90d..77950657da 100644 --- a/best-practices/pl/composer.texy +++ b/best-practices/pl/composer.texy @@ -189,7 +189,7 @@ Jednakże możliwe jest również użycie Composera do załadowania innych klas Następnie musisz uruchomić polecenie `composer dumpautoload` za każdym razem, gdy dokonujesz zmiany i masz ponownie wygenerowane tabele autoloader. Jest to niezwykle uciążliwe i zdecydowanie lepiej powierzyć to zadanie [RobotLoaderowi |robot-loader:], który wykonuje tę samą pracę automatycznie w tle i znacznie szybciej. -Inną możliwością jest zastosowanie się do [PSR-4 |https://www.php-fig.org/psr/psr-4/]. Mówiąc najprościej, jest to system, w którym przestrzenie nazw i nazwy klas odpowiadają strukturom katalogów i nazwom plików, więc na przykład `App\Router\RouterFactory` będzie w pliku `/path/to/App/Router/RouterFactory.php`. Przykładowa konfiguracja: +Inną możliwością jest zastosowanie się do [PSR-4 |https://www.php-fig.org/psr/psr-4/]. Mówiąc najprościej, jest to system, w którym przestrzenie nazw i nazwy klas odpowiadają strukturom katalogów i nazwom plików, więc na przykład `App\Core\RouterFactory` będzie w pliku `/path/to/App/Core/RouterFactory.php`. Przykładowa konfiguracja: ```js { diff --git a/best-practices/pl/pagination.texy b/best-practices/pl/pagination.texy index d6da41b76b..13e39bab4a 100644 --- a/best-practices/pl/pagination.texy +++ b/best-practices/pl/pagination.texy @@ -11,7 +11,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -34,7 +33,7 @@ class ArticleRepository Następnie wstrzykujemy klasę modelu w prezenterze i w metodzie render żądamy opublikowanych artykułów do przekazania do szablonu: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -53,7 +52,7 @@ class HomePresenter extends Nette\Application\UI\Presenter } ``` -W szablonie zajmujemy się następnie wyszczególnieniem artykułów: +Szablon `default.latte` zajmie się następnie listą artykułów: ```latte {block content} @@ -114,7 +113,7 @@ Następnie zabierzemy się do pracy nad modyfikacją prezentera. Do metody rende Następnie rozszerzymy również metodę render, aby uzyskać instancję Paginatora, skonfigurować ją i wybrać odpowiednie artykuły do wyświetlenia w szablonie. HomePresenter po modyfikacjach będzie wyglądał tak: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -190,7 +189,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -210,7 +208,7 @@ class ArticleRepository Nie musimy tworzyć Paginatora w prezenterze, zamiast tego używamy metody klasy `Selection` zwracanej przez repozytorium: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; diff --git a/best-practices/pt/composer.texy b/best-practices/pt/composer.texy index a22608c832..bc48d771b3 100644 --- a/best-practices/pt/composer.texy +++ b/best-practices/pt/composer.texy @@ -189,7 +189,7 @@ Entretanto, também é possível utilizar o Composer para carregar outras classe Em seguida, é necessário executar o comando `composer dumpautoload` a cada mudança e deixar as mesas de auto-carga se regenerar. Isto é extremamente inconveniente, e é muito melhor confiar esta tarefa ao [RobotLoader |robot-loader:], que executa a mesma atividade automaticamente em segundo plano e muito mais rápido. -A segunda opção é seguir o [PSR-4 |https://www.php-fig.org/psr/psr-4/]. Simplesmente dizendo, é um sistema onde os namespaces e nomes de classes correspondem à estrutura do diretório e nomes de arquivos, ou seja, `App\Router\RouterFactory` está localizado no arquivo `/path/to/App/Router/RouterFactory.php`. Exemplo de configuração: +A segunda opção é seguir o [PSR-4 |https://www.php-fig.org/psr/psr-4/]. Simplesmente dizendo, é um sistema onde os namespaces e nomes de classes correspondem à estrutura do diretório e nomes de arquivos, ou seja, `App\Core\RouterFactory` está localizado no arquivo `/path/to/App/Core/RouterFactory.php`. Exemplo de configuração: ```js { diff --git a/best-practices/pt/pagination.texy b/best-practices/pt/pagination.texy index 7fae6d5b5e..149dfc1b72 100644 --- a/best-practices/pt/pagination.texy +++ b/best-practices/pt/pagination.texy @@ -11,7 +11,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -34,7 +33,7 @@ class ArticleRepository No Apresentador injetamos então a classe do modelo e no método de renderização pediremos os artigos publicados que passamos para o modelo: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -53,7 +52,7 @@ class HomePresenter extends Nette\Application\UI\Presenter } ``` -No modelo, nós nos encarregaremos de elaborar uma lista de artigos: +O modelo `default.latte` se encarregará de listar os artigos: ```latte {block content} @@ -114,7 +113,7 @@ O próximo passo é editar o apresentador. Nós encaminharemos o número da pág Também expandimos o método de renderização para obter a instância Paginator, configurando-a e selecionando os artigos corretos a serem exibidos no modelo. Home PagePresenter terá este aspecto: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -190,7 +189,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -210,7 +208,7 @@ class ArticleRepository Não temos que criar o Paginador no Apresentador, em vez disso usaremos o método do objeto `Selection` devolvido pelo repositório: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; diff --git a/best-practices/ro/composer.texy b/best-practices/ro/composer.texy index a2c5f12e81..0905a7c202 100644 --- a/best-practices/ro/composer.texy +++ b/best-practices/ro/composer.texy @@ -189,7 +189,7 @@ Cu toate acestea, este de asemenea posibil să utilizați Composer pentru a înc Ulterior, este necesar să executați comanda `composer dumpautoload` cu fiecare modificare și să lăsați tabelele de autoloading să se regenereze. Acest lucru este extrem de incomod și este mult mai bine să încredințați această sarcină lui [RobotLoader |robot-loader:], care efectuează aceeași activitate în mod automat în fundal și mult mai rapid. -A doua opțiune este să urmați [PSR-4 |https://www.php-fig.org/psr/psr-4/]. Spunând simplu, este un sistem în care spațiile de nume și numele claselor corespund structurii directoarelor și numelor de fișiere, adică `App\Router\RouterFactory` se află în fișierul `/path/to/App/Router/RouterFactory.php`. Exemplu de configurare: +A doua opțiune este să urmați [PSR-4 |https://www.php-fig.org/psr/psr-4/]. Spunând simplu, este un sistem în care spațiile de nume și numele claselor corespund structurii directoarelor și numelor de fișiere, adică `App\Core\RouterFactory` se află în fișierul `/path/to/App/Core/RouterFactory.php`. Exemplu de configurare: ```js { diff --git a/best-practices/ro/pagination.texy b/best-practices/ro/pagination.texy index 40d9de47aa..ee9ac16acc 100644 --- a/best-practices/ro/pagination.texy +++ b/best-practices/ro/pagination.texy @@ -11,7 +11,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -34,7 +33,7 @@ class ArticleRepository În Presenter vom injecta apoi clasa model, iar în metoda render vom cere articolele publicate pe care le vom trece în șablon: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -53,7 +52,7 @@ class HomePresenter extends Nette\Application\UI\Presenter } ``` -În șablon, ne vom ocupa de redarea unei liste de articole: +Șablonul `default.latte` se va ocupa apoi de listarea articolelor: ```latte {block content} @@ -114,7 +113,7 @@ Următorul pas este să modificăm prezentatorul. Vom transmite numărul paginii De asemenea, extindem metoda de randare pentru a obține instanța Paginator, configurând-o și selectând articolele corecte pentru a fi afișate în șablon. HomePresenter va arăta astfel: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -190,7 +189,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -210,7 +208,7 @@ class ArticleRepository Nu trebuie să creăm Paginator în Presenter, în schimb vom folosi metoda obiectului `Selection` returnat de depozit: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; diff --git a/best-practices/ru/composer.texy b/best-practices/ru/composer.texy index 276a92c29e..6e77697023 100644 --- a/best-practices/ru/composer.texy +++ b/best-practices/ru/composer.texy @@ -189,7 +189,7 @@ Packagist.org — глобальный репозиторий .[#toc-packagist-o Впоследствии необходимо выполнять команду `composer dumpautoload` при каждом изменении и позволять таблицам автозагрузки регенерироваться. Это крайне неудобно, и гораздо лучше доверить эту задачу [RobotLoader|robot-loader:], который выполняет ту же самую работу автоматически в фоновом режиме и гораздо быстрее. -Второй вариант — следовать [PSR-4 |https://www.php-fig.org/psr/psr-4/]. Проще говоря, это система, в которой пространства имен и имена классов соответствуют структуре каталогов и именам файлов, т. е. `App\Router\RouterFactory` находится в файле `/path/to/App/Router/RouterFactory.php`. Пример конфигурации: +Второй вариант — следовать [PSR-4 |https://www.php-fig.org/psr/psr-4/]. Проще говоря, это система, в которой пространства имен и имена классов соответствуют структуре каталогов и именам файлов, т. е. `App\Core\RouterFactory` находится в файле `/path/to/App/Core/RouterFactory.php`. Пример конфигурации: ```js { diff --git a/best-practices/ru/pagination.texy b/best-practices/ru/pagination.texy index 6d384a2ebf..87693d2c25 100644 --- a/best-practices/ru/pagination.texy +++ b/best-practices/ru/pagination.texy @@ -11,7 +11,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -34,7 +33,7 @@ class ArticleRepository Затем в презентере мы вводим класс модели и в методе `render` запрашиваем опубликованные статьи, которые передаем в шаблон: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -53,7 +52,7 @@ class HomePresenter extends Nette\Application\UI\Presenter } ``` -В шаблоне мы позаботимся о выводе списка статей: +Шаблон `default.latte` позаботится о перечислении статей: ```latte {block content} @@ -114,7 +113,7 @@ class ArticleRepository Мы также расширяем метод `render` для получения экземпляра Paginator, его настройки и выбора нужных статей для отображения в шаблоне. HomePresenter будет выглядеть следующим образом: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -190,7 +189,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -210,7 +208,7 @@ class ArticleRepository Нам не нужно создавать Paginator в презентере, вместо этого мы будем использовать метод объекта `Selection`, возвращаемый репозиторием: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; diff --git a/best-practices/sl/composer.texy b/best-practices/sl/composer.texy index 97a8e4ad75..6a3fa3ffdc 100644 --- a/best-practices/sl/composer.texy +++ b/best-practices/sl/composer.texy @@ -189,7 +189,7 @@ Vendar je mogoče Composer uporabiti tudi za nalaganje drugih razredov zunaj map Nato je treba ob vsaki spremembi zagnati ukaz `composer dumpautoload` in pustiti, da se tabele za samodejno nalaganje regenerirajo. To je izredno neprijetno in veliko bolje je to nalogo zaupati programu [RobotLoader |robot-loader:], ki isto dejavnost opravi samodejno v ozadju in veliko hitreje. -Druga možnost je, da sledite [priporočilu PSR-4 |https://www.php-fig.org/psr/psr-4/]. Preprosto povedano, gre za sistem, v katerem imenska območja in imena razredov ustrezajo imeniški strukturi in imenom datotek, tj. `App\Router\RouterFactory` se nahaja v datoteki `/path/to/App/Router/RouterFactory.php`. Primer konfiguracije: +Druga možnost je, da sledite [priporočilu PSR-4 |https://www.php-fig.org/psr/psr-4/]. Preprosto povedano, gre za sistem, v katerem imenska območja in imena razredov ustrezajo imeniški strukturi in imenom datotek, tj. `App\Core\RouterFactory` se nahaja v datoteki `/path/to/App/Core/RouterFactory.php`. Primer konfiguracije: ```js { diff --git a/best-practices/sl/pagination.texy b/best-practices/sl/pagination.texy index fff9e4bf1f..f0136cebbc 100644 --- a/best-practices/sl/pagination.texy +++ b/best-practices/sl/pagination.texy @@ -11,7 +11,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -34,7 +33,7 @@ class ArticleRepository V Presenter nato injiciramo razred model in v metodi render bomo zahtevali objavljene članke, ki jih posredujemo predlogi: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -53,7 +52,7 @@ class HomePresenter extends Nette\Application\UI\Presenter } ``` -V predlogi bomo poskrbeli za upodobitev seznama člankov: +Predloga `default.latte` bo nato poskrbela za seznam člankov: ```latte {block content} @@ -114,7 +113,7 @@ Naslednji korak je urejanje predstavnika. Številko trenutno prikazane strani bo Metodo upodabljanja razširimo tudi na pridobitev primerka Paginatorja, njegovo nastavitev in izbiro pravilnih člankov za prikaz v predlogi. HomePresenter bo videti takole: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -190,7 +189,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -210,7 +208,7 @@ class ArticleRepository Namesto tega bomo uporabili metodo predmeta `Selection`, ki ga je vrnil repozitorij: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; diff --git a/best-practices/tr/composer.texy b/best-practices/tr/composer.texy index c16a3f0864..f16faee810 100644 --- a/best-practices/tr/composer.texy +++ b/best-practices/tr/composer.texy @@ -189,7 +189,7 @@ Ancak, Composer'ı `vendor` klasörü dışındaki diğer sınıfları yüklemek Daha sonra, her değişiklikte `composer dumpautoload` komutunu çalıştırmak ve otomatik yükleme tablolarının yeniden oluşturulmasına izin vermek gerekir. Bu son derece zahmetlidir ve bu görevi, aynı etkinliği arka planda otomatik olarak ve çok daha hızlı gerçekleştiren [RobotLoader'a |robot-loader:] emanet etmek çok daha iyidir. -İkinci seçenek [PSR-4'ü |https://www.php-fig.org/psr/psr-4/] takip etmektir. Basitçe söylemek gerekirse, ad alanlarının ve sınıf adlarının dizin yapısına ve dosya adlarına karşılık geldiği bir sistemdir, yani `App\Router\RouterFactory`, `/path/to/App/Router/RouterFactory.php` dosyasında bulunur. Yapılandırma örneği: +İkinci seçenek [PSR-4'ü |https://www.php-fig.org/psr/psr-4/] takip etmektir. Basitçe söylemek gerekirse, ad alanlarının ve sınıf adlarının dizin yapısına ve dosya adlarına karşılık geldiği bir sistemdir, yani `App\Core\RouterFactory`, `/path/to/App/Core/RouterFactory.php` dosyasında bulunur. Yapılandırma örneği: ```js { diff --git a/best-practices/tr/pagination.texy b/best-practices/tr/pagination.texy index 0f0d378bfd..e6513d47d1 100644 --- a/best-practices/tr/pagination.texy +++ b/best-practices/tr/pagination.texy @@ -11,7 +11,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -34,7 +33,7 @@ class ArticleRepository Presenter'da daha sonra model sınıfını enjekte edeceğiz ve render yönteminde şablona aktardığımız yayınlanmış makaleleri isteyeceğiz: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -53,7 +52,7 @@ class HomePresenter extends Nette\Application\UI\Presenter } ``` -Şablonda, bir makale listesi oluşturmaya özen göstereceğiz: +`default.latte` şablonu daha sonra makaleleri listelemekle ilgilenecektir: ```latte {block content} @@ -114,7 +113,7 @@ Bir sonraki adım sunucuyu düzenlemektir. Şu anda görüntülenen sayfanın nu Ayrıca Paginator örneğini almak, ayarlamak ve şablonda görüntülenecek doğru makaleleri seçmek için render yöntemini genişletiyoruz. HomePresenter şu şekilde görünecektir: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -190,7 +189,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -210,7 +208,7 @@ class ArticleRepository Presenter'da Paginator oluşturmak zorunda değiliz, bunun yerine repository tarafından döndürülen `Selection` nesnesinin yöntemini kullanacağız: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; diff --git a/best-practices/uk/composer.texy b/best-practices/uk/composer.texy index edca818c9a..e6777c8700 100644 --- a/best-practices/uk/composer.texy +++ b/best-practices/uk/composer.texy @@ -189,7 +189,7 @@ Packagist.org - глобальний репозиторій .[#toc-packagist-org Згодом необхідно виконувати команду `composer dumpautoload` при кожній зміні та дозволяти таблицям автозавантаження регенеруватися. Це вкрай незручно, і набагато краще довірити цю задачу [RobotLoader |robot-loader:], який виконує ту ж саму роботу автоматично у фоновому режимі і набагато швидше. -Другий варіант - слідувати [PSR-4 |https://www.php-fig.org/psr/psr-4/]. Простіше кажучи, це система, в якій простори імен та імена класів відповідають структурі каталогів та іменам файлів, тобто `App\Router\RouterFactory` знаходиться у файлі `/path/to/App/Router/RouterFactory.php`. Приклад конфігурації: +Другий варіант - слідувати [PSR-4 |https://www.php-fig.org/psr/psr-4/]. Простіше кажучи, це система, в якій простори імен та імена класів відповідають структурі каталогів та іменам файлів, тобто `App\Core\RouterFactory` знаходиться у файлі `/path/to/App/Core/RouterFactory.php`. Приклад конфігурації: ```js { diff --git a/best-practices/uk/pagination.texy b/best-practices/uk/pagination.texy index 56ddd52028..c74c942c2e 100644 --- a/best-practices/uk/pagination.texy +++ b/best-practices/uk/pagination.texy @@ -11,7 +11,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -34,7 +33,7 @@ class ArticleRepository Потім у презентері ми вводимо клас моделі і в методі `render` запитуємо опубліковані статті, які передаємо в шаблон: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -53,7 +52,7 @@ class HomePresenter extends Nette\Application\UI\Presenter } ``` -У шаблоні ми подбаємо про виведення списку статей: +Після цього шаблон `default.latte` подбає про список статей: ```latte {block content} @@ -114,7 +113,7 @@ class ArticleRepository Ми також розширюємо метод `render` для отримання екземпляра Paginator, його налаштування та вибору потрібних статей для відображення в шаблоні. HomePresenter матиме такий вигляд: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; @@ -190,7 +189,6 @@ namespace App\Model; use Nette; - class ArticleRepository { public function __construct( @@ -210,7 +208,7 @@ class ArticleRepository Нам не потрібно створювати Paginator у презентері, натомість ми використовуватимемо метод об'єкта `Selection`, який повертає сховище: ```php -namespace App\Presenters; +namespace App\UI\Home; use Nette; use App\Model\ArticleRepository; diff --git a/dependency-injection/bg/configuration.texy b/dependency-injection/bg/configuration.texy index b9ff04bf42..a1bfa25820 100644 --- a/dependency-injection/bg/configuration.texy +++ b/dependency-injection/bg/configuration.texy @@ -67,7 +67,7 @@ parameters: ```neon decorator: # За всички услуги, които са екземпляри на този клас или интерфейс - App\Presenters\BasePresenter: + App\UI\BasePresenter: setup: - setProjectId(10) # извикване на този метод - $absoluteUrls = true # и задаване на променлива diff --git a/dependency-injection/bg/factory.texy b/dependency-injection/bg/factory.texy index 43699fde67..b50ea73905 100644 --- a/dependency-injection/bg/factory.texy +++ b/dependency-injection/bg/factory.texy @@ -220,7 +220,7 @@ services: ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter - App\Model\DatabaseAccessor( db1: @database.db1.context ) diff --git a/dependency-injection/cs/configuration.texy b/dependency-injection/cs/configuration.texy index 4b80e78339..0ae0adcd06 100644 --- a/dependency-injection/cs/configuration.texy +++ b/dependency-injection/cs/configuration.texy @@ -67,7 +67,7 @@ Jak upravit hromadně všechny služby určitého typu? Třeba zavolat určitou ```neon decorator: # u všech služeb, co jsou instancí této třídy nebo rozhraní - App\Presenters\BasePresenter: + App\UI\BasePresenter: setup: - setProjectId(10) # zavolej tuto metodu - $absoluteUrls = true # a nastav proměnnou diff --git a/dependency-injection/cs/factory.texy b/dependency-injection/cs/factory.texy index 082f32d37e..94da4bbd94 100644 --- a/dependency-injection/cs/factory.texy +++ b/dependency-injection/cs/factory.texy @@ -220,7 +220,7 @@ Druhou možností je využít k definici [tagy|services#Tagy]: ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter - App\Model\DatabaseAccessor( db1: @database.db1.explorer ) diff --git a/dependency-injection/de/configuration.texy b/dependency-injection/de/configuration.texy index d8fd5fbb37..81e37a18f5 100644 --- a/dependency-injection/de/configuration.texy +++ b/dependency-injection/de/configuration.texy @@ -67,7 +67,7 @@ Wie kann man alle Dienste eines bestimmten Typs als Ganzes bearbeiten? Müssen S ```neon decorator: # für alle Dienste, die Instanzen dieser Klasse oder Schnittstelle sind - App\Presenters\BasePresenter: + App\UI\BasePresenter: setup: - setProjectId(10) # diese Methode aufrufen - $absoluteUrls = true # und setze die Variable diff --git a/dependency-injection/de/factory.texy b/dependency-injection/de/factory.texy index c5ea50f342..2ff999d106 100644 --- a/dependency-injection/de/factory.texy +++ b/dependency-injection/de/factory.texy @@ -220,7 +220,7 @@ Eine weitere Möglichkeit, eine Multifabrik zu definieren, ist die Verwendung vo ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter - App\Model\DatabaseAccessor( db1: @database.db1.explorer ) diff --git a/dependency-injection/el/configuration.texy b/dependency-injection/el/configuration.texy index b99ecbbcf9..2fb9c48458 100644 --- a/dependency-injection/el/configuration.texy +++ b/dependency-injection/el/configuration.texy @@ -67,7 +67,7 @@ parameters: ```neon decorator: # για όλες τις υπηρεσίες που είναι στιγμιότυπα αυτής της κλάσης ή διεπαφής - App\Presenters\BasePresenter: + App\UI\BasePresenter: setup: - setProjectId(10) # καλέστε αυτή τη μέθοδο - $absoluteUrls = true # και ορίστε τη μεταβλητή diff --git a/dependency-injection/el/factory.texy b/dependency-injection/el/factory.texy index ae2f1951f0..d6f61b4c87 100644 --- a/dependency-injection/el/factory.texy +++ b/dependency-injection/el/factory.texy @@ -220,7 +220,7 @@ services: ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter - App\Model\DatabaseAccessor( db1: @database.db1.explorer ) diff --git a/dependency-injection/en/configuration.texy b/dependency-injection/en/configuration.texy index 4400910043..baa5467cfb 100644 --- a/dependency-injection/en/configuration.texy +++ b/dependency-injection/en/configuration.texy @@ -67,7 +67,7 @@ How to bulk edit all services of a certain type? Need to call a certain method f ```neon decorator: # for all services that are instances of this class or interface - App\Presenters\BasePresenter: + App\UI\BasePresenter: setup: - setProjectId(10) # call this method - $absoluteUrls = true # and set the variable diff --git a/dependency-injection/en/factory.texy b/dependency-injection/en/factory.texy index e96c7c385c..d3cc3a3c6c 100644 --- a/dependency-injection/en/factory.texy +++ b/dependency-injection/en/factory.texy @@ -220,7 +220,7 @@ Another option how to define a multifactory is to use [tags|services#Tags]: ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter - App\Model\DatabaseAccessor( db1: @database.db1.explorer ) diff --git a/dependency-injection/es/configuration.texy b/dependency-injection/es/configuration.texy index ae0b652501..536a89a5d1 100644 --- a/dependency-injection/es/configuration.texy +++ b/dependency-injection/es/configuration.texy @@ -67,7 +67,7 @@ Decorador .[#toc-decorator] ```neon decorator: # para todos los servicios que son instancias de esta clase o interfaz - App\Presenters\BasePresenter: + App\UI\BasePresenter: setup: - setProjectId(10) # llamar a este método - $absoluteUrls = true # y establecer la variable diff --git a/dependency-injection/es/factory.texy b/dependency-injection/es/factory.texy index 4e6151853f..ef367ff00a 100644 --- a/dependency-injection/es/factory.texy +++ b/dependency-injection/es/factory.texy @@ -220,7 +220,7 @@ Otra opción para definir un multifactory es utilizar [tags|services#Tags]: ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter - App\Model\DatabaseAccessor( db1: @database.db1.explorer ) diff --git a/dependency-injection/fr/configuration.texy b/dependency-injection/fr/configuration.texy index 1970ea21e7..4241d58871 100644 --- a/dependency-injection/fr/configuration.texy +++ b/dependency-injection/fr/configuration.texy @@ -67,7 +67,7 @@ Comment modifier en masse tous les services d'un certain type ? Vous avez besoin ```neon decorator: # pour tous les services qui sont des instances de cette classe ou interface - App\Presenters\BasePresenter: + App\UI\BasePresenter: setup: - setProjectId(10) # appelle cette méthode - $absoluteUrls = true # et définir la variable diff --git a/dependency-injection/fr/factory.texy b/dependency-injection/fr/factory.texy index 7c49950361..836e6ee438 100644 --- a/dependency-injection/fr/factory.texy +++ b/dependency-injection/fr/factory.texy @@ -220,7 +220,7 @@ Une autre option pour définir un multifactory est d'utiliser des [balises |serv ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter - App\Model\DatabaseAccessor( db1: @database.db1.explorer ) diff --git a/dependency-injection/hu/configuration.texy b/dependency-injection/hu/configuration.texy index ed9aa0144e..16d1097e80 100644 --- a/dependency-injection/hu/configuration.texy +++ b/dependency-injection/hu/configuration.texy @@ -67,7 +67,7 @@ Hogyan lehet egy bizonyos típusú összes szolgáltatást tömegesen szerkeszte ```neon decorator: # minden olyan szolgáltatáshoz, amely ennek az osztálynak vagy interfésznek a példánya. - App\Presenters\BasePresenter: + App\UI\BasePresenter: setup: - # hívja meg ezt a metódust - $absoluteUrls = true # és állítsuk be a változót diff --git a/dependency-injection/hu/factory.texy b/dependency-injection/hu/factory.texy index 438effdcc6..5ae2bec739 100644 --- a/dependency-injection/hu/factory.texy +++ b/dependency-injection/hu/factory.texy @@ -220,7 +220,7 @@ Egy másik lehetőség a multifactory definiálására a [címkék |services#Tag ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter - App\Model\DatabaseAccessor( db1: @database.db1.explorer ) diff --git a/dependency-injection/it/configuration.texy b/dependency-injection/it/configuration.texy index 628d6a3bc0..f1c063c0ad 100644 --- a/dependency-injection/it/configuration.texy +++ b/dependency-injection/it/configuration.texy @@ -67,7 +67,7 @@ Come modificare in blocco tutti i servizi di un certo tipo? È necessario chiama ```neon decorator: # per tutti i servizi che sono istanze di questa classe o interfaccia - App\Presenters\BasePresenter: + App\UI\BasePresenter: setup: - setProjectId(10) # chiama questo metodo - $absoluteUrls = true # e imposta la variabile diff --git a/dependency-injection/it/factory.texy b/dependency-injection/it/factory.texy index 8eafe7bbc9..5487c86971 100644 --- a/dependency-injection/it/factory.texy +++ b/dependency-injection/it/factory.texy @@ -220,7 +220,7 @@ Un'altra opzione per definire una multifactory è quella di usare i [tag |servic ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter - App\Model\DatabaseAccessor( db1: @database.db1.explorer ) diff --git a/dependency-injection/ja/configuration.texy b/dependency-injection/ja/configuration.texy index a6417023d2..e2c485badc 100644 --- a/dependency-injection/ja/configuration.texy +++ b/dependency-injection/ja/configuration.texy @@ -67,7 +67,7 @@ parameters: ```neon decorator: # for all services that are instances of this class or interface - App\Presenters\BasePresenter: + App\UI\BasePresenter: setup: - setProjectId(10) # call this method - $absoluteUrls = true # and set the variable diff --git a/dependency-injection/ja/factory.texy b/dependency-injection/ja/factory.texy index 80d8064a3c..e5e83e538e 100644 --- a/dependency-injection/ja/factory.texy +++ b/dependency-injection/ja/factory.texy @@ -220,7 +220,7 @@ services: ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter - App\Model\DatabaseAccessor( db1: @database.db1.explorer ) diff --git a/dependency-injection/pl/configuration.texy b/dependency-injection/pl/configuration.texy index f3ed899ede..2e1ec832d2 100644 --- a/dependency-injection/pl/configuration.texy +++ b/dependency-injection/pl/configuration.texy @@ -67,7 +67,7 @@ Jak masowo edytować wszystkie usługi danego typu? Na przykład wywołaj okreś ```neon decorator: # dla wszystkich usług, które są instancjami tej klasy lub interfejsu - App\Presenters\BasePresenter: + App\UI\BasePresenter: setup: - setProjectId(10) # wywołaj tę metodę - $absoluteUrls = true # i ustawić zmienną diff --git a/dependency-injection/pl/factory.texy b/dependency-injection/pl/factory.texy index 1658beda00..f566dad4ee 100644 --- a/dependency-injection/pl/factory.texy +++ b/dependency-injection/pl/factory.texy @@ -220,7 +220,7 @@ Druga opcja to użycie [tagów |services#Tags] do definicji: ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter - App\Model\DatabaseAccessor( db1: @database.db1.explorer ) diff --git a/dependency-injection/pt/configuration.texy b/dependency-injection/pt/configuration.texy index eab09bb9dc..e6fd0e2aa6 100644 --- a/dependency-injection/pt/configuration.texy +++ b/dependency-injection/pt/configuration.texy @@ -67,7 +67,7 @@ Como editar em massa todos os serviços de um determinado tipo? Precisa chamar u ```neon decorator: # para todos os serviços que são instâncias desta classe ou interface - App\Presenters\BasePresenter: + App\UI\BasePresenter: setup: - setProjectId(10) # chamar este método - $absoluteUrls = true # e definir a variável diff --git a/dependency-injection/pt/factory.texy b/dependency-injection/pt/factory.texy index 785b1ea569..293f3418b7 100644 --- a/dependency-injection/pt/factory.texy +++ b/dependency-injection/pt/factory.texy @@ -220,7 +220,7 @@ Outra opção para definir uma multifábrica é a utilização de [etiquetas |se ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter - App\Model\DatabaseAccessor( db1: @database.db1.explorer ) diff --git a/dependency-injection/ro/configuration.texy b/dependency-injection/ro/configuration.texy index 92e4c59ecd..311cbfd773 100644 --- a/dependency-injection/ro/configuration.texy +++ b/dependency-injection/ro/configuration.texy @@ -67,7 +67,7 @@ Cum se pot edita în bloc toate serviciile de un anumit tip? Aveți nevoie să a ```neon decorator: # pentru toate serviciile care sunt instanțe ale acestei clase sau interfețe - App\Presenters\BasePresenter: + App\UI\BasePresenter: setup: - setProjectId(10) # apelează această metodă - $absoluteUrls = true # și setează variabila diff --git a/dependency-injection/ro/factory.texy b/dependency-injection/ro/factory.texy index 25a1475f01..d282fe1624 100644 --- a/dependency-injection/ro/factory.texy +++ b/dependency-injection/ro/factory.texy @@ -220,7 +220,7 @@ O altă opțiune de definire a unui multifactorial este utilizarea [etichetelor ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter - App\Model\DatabaseAccessor( db1: @database.db1.explorer ) diff --git a/dependency-injection/ru/configuration.texy b/dependency-injection/ru/configuration.texy index 6fc86f0476..db9e0d2c8d 100644 --- a/dependency-injection/ru/configuration.texy +++ b/dependency-injection/ru/configuration.texy @@ -67,7 +67,7 @@ parameters: ```neon decorator: # Для всех сервисов, являющихся экземплярами этого класса или интерфейса - App\Presenters\BasePresenter: + App\UI\BasePresenter: setup: - setProjectId(10) # вызываем этот метод - $absoluteUrls = true # и задаем переменную diff --git a/dependency-injection/ru/factory.texy b/dependency-injection/ru/factory.texy index ebe578c30c..21149c2339 100644 --- a/dependency-injection/ru/factory.texy +++ b/dependency-injection/ru/factory.texy @@ -220,7 +220,7 @@ services: ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter - App\Model\DatabaseAccessor( db1: @database.db1.context ) diff --git a/dependency-injection/sl/configuration.texy b/dependency-injection/sl/configuration.texy index 5ab5cf0e50..f815b42c31 100644 --- a/dependency-injection/sl/configuration.texy +++ b/dependency-injection/sl/configuration.texy @@ -67,7 +67,7 @@ Kako množično urediti vse storitve določene vrste? Ali morate poklicati dolo ```neon decorator: # za vse storitve, ki so primerki tega razreda ali vmesnika. - App\Presenters\BasePresenter: + App\UI\BasePresenter: setup: - setProjectId(10) # pokliče to metodo - $absoluteUrls = true # in nastavi spremenljivko diff --git a/dependency-injection/sl/factory.texy b/dependency-injection/sl/factory.texy index 9c7a9dcb45..6fba37cb35 100644 --- a/dependency-injection/sl/factory.texy +++ b/dependency-injection/sl/factory.texy @@ -220,7 +220,7 @@ Druga možnost, kako opredeliti večpredstavnostno zbirko, je uporaba [oznak |se ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter - App\Model\DatabaseAccessor( db1: @database.db1.explorer ) diff --git a/dependency-injection/tr/configuration.texy b/dependency-injection/tr/configuration.texy index 03cc7541d7..8861ae66a8 100644 --- a/dependency-injection/tr/configuration.texy +++ b/dependency-injection/tr/configuration.texy @@ -67,7 +67,7 @@ Belirli bir türdeki tüm hizmetleri toplu olarak nasıl düzenleyebilirim? Beli ```neon decorator: # bu sınıfın veya arayüzün örneği olan tüm hizmetler için - App\Presenters\BasePresenter: + App\UI\BasePresenter: setup: - setProjectId(10) # bu yöntemi çağır - $absoluteUrls = true # ve değişkeni ayarlayın diff --git a/dependency-injection/tr/factory.texy b/dependency-injection/tr/factory.texy index 26bd3c9ab1..60de28c2be 100644 --- a/dependency-injection/tr/factory.texy +++ b/dependency-injection/tr/factory.texy @@ -220,7 +220,7 @@ Bir multifactory'nin nasıl tanımlanacağına dair bir başka seçenek de [etik ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter - App\Model\DatabaseAccessor( db1: @database.db1.explorer ) diff --git a/dependency-injection/uk/configuration.texy b/dependency-injection/uk/configuration.texy index 47b57a328e..e29d6c661a 100644 --- a/dependency-injection/uk/configuration.texy +++ b/dependency-injection/uk/configuration.texy @@ -67,7 +67,7 @@ parameters: ```neon decorator: # Для всіх сервісів, які є екземплярами цього класу або інтерфейсу - App\Presenters\BasePresenter: + App\UI\BasePresenter: setup: - setProjectId(10) # викликаємо цей метод - $absoluteUrls = true # і задаємо змінну diff --git a/dependency-injection/uk/factory.texy b/dependency-injection/uk/factory.texy index b3dd17aa8e..a5c0dc0806 100644 --- a/dependency-injection/uk/factory.texy +++ b/dependency-injection/uk/factory.texy @@ -220,7 +220,7 @@ services: ```neon services: - - App\Router\RouterFactory::createRouter + - App\Core\RouterFactory::createRouter - App\Model\DatabaseAccessor( db1: @database.db1.context ) diff --git a/forms/bg/in-presenter.texy b/forms/bg/in-presenter.texy index 6a96b8e901..8ab681eadd 100644 --- a/forms/bg/in-presenter.texy +++ b/forms/bg/in-presenter.texy @@ -30,7 +30,7 @@ $form->onSuccess[] = [$this, 'formSucceeded']; От гледна точка на водещия формулярът е общ компонент. Затова той се третира като компонент и се включва в презентатора чрез [метода factory |application:components#Factory-Methods]. Това ще изглежда по следния начин: -```php .{file:app/Presenters/HomePresenter.php} +```php .{file:app/UI/Home/HomePresenter.php} use Nette; use Nette\Application\UI\Form; @@ -59,7 +59,7 @@ class HomePresenter extends Nette\Application\UI\Presenter А визуализирането в шаблона се извършва с помощта на тага `{control}`: -```latte .{file:app/Presenters/templates/Home/default.latte} +```latte .{file:app/UI/Home/default.latte}

Регистрация

{control registrationForm} diff --git a/forms/cs/in-presenter.texy b/forms/cs/in-presenter.texy index e8d3bddccd..807bdb1822 100644 --- a/forms/cs/in-presenter.texy +++ b/forms/cs/in-presenter.texy @@ -30,7 +30,7 @@ Formulář v presenteru je objekt třídy `Nette\Application\UI\Form`, její př Z pohledu presenteru je formulář běžná komponenta. Proto se s ním jako s komponentou zachází a začleníme ji do presenteru pomocí [tovární metody |application:components#Tovární metody]. Bude to vypadat takto: -```php .{file:app/Presenters/HomePresenter.php} +```php .{file:app/UI/Home/HomePresenter.php} use Nette; use Nette\Application\UI\Form; @@ -59,7 +59,7 @@ class HomePresenter extends Nette\Application\UI\Presenter A v šabloně formulář vykreslíme značkou `{control}`: -```latte .{file:app/Presenters/templates/Home/default.latte} +```latte .{file:app/UI/Home/default.latte}

Registrace

{control registrationForm} diff --git a/forms/de/in-presenter.texy b/forms/de/in-presenter.texy index 5397143c73..7a6e875a70 100644 --- a/forms/de/in-presenter.texy +++ b/forms/de/in-presenter.texy @@ -30,7 +30,7 @@ Das Formular im Presenter ist ein Objekt der Klasse `Nette\Application\UI\Form`, Aus der Sicht des Präsentators ist das Formular eine gemeinsame Komponente. Daher wird es als Komponente behandelt und mit der [Factory-Methode |application:components#Factory Methods] in den Presenter eingebunden. Das sieht dann wie folgt aus: -```php .{file:app/Presenters/HomePresenter.php} +```php .{file:app/UI/Home/HomePresenter.php} use Nette; use Nette\Application\UI\Form; @@ -59,7 +59,7 @@ class HomePresenter extends Nette\Application\UI\Presenter Und das Rendern in der Vorlage erfolgt mit dem Tag `{control}`: -```latte .{file:app/Presenters/templates/Home/default.latte} +```latte .{file:app/UI/Home/default.latte}

Registration

{control registrationForm} diff --git a/forms/el/in-presenter.texy b/forms/el/in-presenter.texy index ee4a9f9280..5245fbb365 100644 --- a/forms/el/in-presenter.texy +++ b/forms/el/in-presenter.texy @@ -30,7 +30,7 @@ $form->onSuccess[] = [$this, 'formSucceeded']; Από τη σκοπιά του παρουσιαστή, η φόρμα είναι ένα κοινό συστατικό. Ως εκ τούτου, αντιμετωπίζεται ως συστατικό και ενσωματώνεται στον παρουσιαστή χρησιμοποιώντας τη [μέθοδο factory |application:components#Factory Methods]. Αυτό θα έχει την εξής μορφή: -```php .{file:app/Presenters/HomePresenter.php} +```php .{file:app/UI/Home/HomePresenter.php} use Nette; use Nette\Application\UI\Form; @@ -59,7 +59,7 @@ class HomePresenter extends Nette\Application\UI\Presenter Και η απόδοση στο πρότυπο γίνεται με τη χρήση της ετικέτας `{control}`: -```latte .{file:app/Presenters/templates/Home/default.latte} +```latte .{file:app/UI/Home/default.latte}

Registration

{control registrationForm} diff --git a/forms/en/in-presenter.texy b/forms/en/in-presenter.texy index 5d2fe73214..5f94cf5b32 100644 --- a/forms/en/in-presenter.texy +++ b/forms/en/in-presenter.texy @@ -30,7 +30,7 @@ The form in the presenter is an object of the class `Nette\Application\UI\Form`, From the presenter's point of view, the form is a common component. Therefore, it is treated as a component and incorporated into the presenter using [factory method |application:components#Factory Methods]. It will look like this: -```php .{file:app/Presenters/HomePresenter.php} +```php .{file:app/UI/Home/HomePresenter.php} use Nette; use Nette\Application\UI\Form; @@ -59,7 +59,7 @@ class HomePresenter extends Nette\Application\UI\Presenter And render in template is done using `{control}` tag: -```latte .{file:app/Presenters/templates/Home/default.latte} +```latte .{file:app/UI/Home/default.latte}

Registration

{control registrationForm} diff --git a/forms/es/in-presenter.texy b/forms/es/in-presenter.texy index a6d66ed0e3..99d39ebc29 100644 --- a/forms/es/in-presenter.texy +++ b/forms/es/in-presenter.texy @@ -30,7 +30,7 @@ El formulario en el presentador es un objeto de la clase `Nette\Application\UI\F Desde el punto de vista del presentador, el formulario es un componente común. Por lo tanto, se trata como un componente y se incorpora al presentador utilizando [el método factory |application:components#Factory Methods]. Tendrá el siguiente aspecto: -```php .{file:app/Presenters/HomePresenter.php} +```php .{file:app/UI/Home/HomePresenter.php} use Nette; use Nette\Application\UI\Form; @@ -59,7 +59,7 @@ class HomePresenter extends Nette\Application\UI\Presenter Y el renderizado en la plantilla se realiza utilizando la etiqueta `{control}`: -```latte .{file:app/Presenters/templates/Home/default.latte} +```latte .{file:app/UI/Home/default.latte}

Registro

{control registrationForm} diff --git a/forms/fr/in-presenter.texy b/forms/fr/in-presenter.texy index 8f8bcb4739..15a544b6a7 100644 --- a/forms/fr/in-presenter.texy +++ b/forms/fr/in-presenter.texy @@ -30,7 +30,7 @@ Le formulaire dans le présentateur est un objet de la classe `Nette\Application Du point de vue du présentateur, le formulaire est un composant commun. Par conséquent, il est traité comme un composant et incorporé dans le présentateur à l'aide de la [méthode factory |application:components#Factory Methods]. Cela ressemblera à ceci : -```php .{file:app/Presenters/HomePresenter.php} +```php .{file:app/UI/Home/HomePresenter.php} use Nette; use Nette\Application\UI\Form; @@ -59,7 +59,7 @@ class HomePresenter extends Nette\Application\UI\Presenter Et le rendu dans le modèle est effectué à l'aide de la balise `{control}`: -```latte .{file:app/Presenters/templates/Home/default.latte} +```latte .{file:app/UI/Home/default.latte}

Registration

{control registrationForm} diff --git a/forms/hu/in-presenter.texy b/forms/hu/in-presenter.texy index 70f4742247..980683e6c4 100644 --- a/forms/hu/in-presenter.texy +++ b/forms/hu/in-presenter.texy @@ -30,7 +30,7 @@ A prezenterben lévő űrlap a `Nette\Application\UI\Form` osztály objektuma, e A bemutató szempontjából az űrlap egy közös komponens. Ezért komponensként kezeljük, és a [factory metódus |application:components#Factory Methods] segítségével beépítjük a prezentálóba. Ez így fog kinézni: -```php .{file:app/Presenters/HomePresenter.php} +```php .{file:app/UI/Home/HomePresenter.php} use Nette; use Nette\Application\UI\Form; @@ -59,7 +59,7 @@ class HomePresenter extends Nette\Application\UI\Presenter A sablonban történő megjelenítés pedig a `{control}` tag használatával történik: -```latte .{file:app/Presenters/templates/Home/default.latte} +```latte .{file:app/UI/Home/default.latte}

Registration

{control registrationForm} diff --git a/forms/it/in-presenter.texy b/forms/it/in-presenter.texy index bf398c453b..2c9e8433c0 100644 --- a/forms/it/in-presenter.texy +++ b/forms/it/in-presenter.texy @@ -30,7 +30,7 @@ Il modulo nel presentatore è un oggetto della classe `Nette\Application\UI\Form Dal punto di vista del presentatore, il modulo è un componente comune. Pertanto, viene trattato come un componente e incorporato nel presentatore con il [metodo factory |application:components#Factory Methods]. L'aspetto sarà il seguente: -```php .{file:app/Presenters/HomePresenter.php} +```php .{file:app/UI/Home/HomePresenter.php} use Nette; use Nette\Application\UI\Form; @@ -59,7 +59,7 @@ class HomePresenter extends Nette\Application\UI\Presenter E il rendering nel template viene effettuato utilizzando il tag `{control}`: -```latte .{file:app/Presenters/templates/Home/default.latte} +```latte .{file:app/UI/Home/default.latte}

Registration

{control registrationForm} diff --git a/forms/pl/in-presenter.texy b/forms/pl/in-presenter.texy index afa333ac67..464a7951fa 100644 --- a/forms/pl/in-presenter.texy +++ b/forms/pl/in-presenter.texy @@ -30,7 +30,7 @@ Formularz w prezenterze jest obiektem klasy `Nette\Application\UI\Form`, jego po Z punktu widzenia prezentera formularz jest normalnym komponentem. Dlatego traktujemy go jako komponent i włączamy do prezentera za pomocą [metody factory |application:components#Factory-Methods]. Będzie to wyglądało tak: -```php .{file:app/Presenters/HomePresenter.php} +```php .{file:app/UI/Home/HomePresenter.php} use Nette; use Nette\Application\UI\Form; @@ -59,7 +59,7 @@ class HomePresenter extends Nette\Application\UI\Presenter A w szablonie renderujemy formularz z tagiem `{control}`: -```latte .{file:app/Presenters/templates/Home/default.latte} +```latte .{file:app/UI/Home/default.latte}

Registrace

{control registrationForm} diff --git a/forms/pt/in-presenter.texy b/forms/pt/in-presenter.texy index a21a2650d3..76aee63d4f 100644 --- a/forms/pt/in-presenter.texy +++ b/forms/pt/in-presenter.texy @@ -30,7 +30,7 @@ A forma no apresentador é um objeto da classe `Nette\Application\UI\Form`, seu Do ponto de vista do apresentador, a forma é um componente comum. Portanto, ele é tratado como um componente e incorporado ao apresentador usando [o método de fábrica |application:components#Factory Methods]. Será parecido com isto: -```php .{file:app/Presenters/HomePresenter.php} +```php .{file:app/UI/Home/HomePresenter.php} use Nette; use Nette\Application\UI\Form; @@ -59,7 +59,7 @@ class HomePresenter extends Nette\Application\UI\Presenter E a renderização em modelo é feita usando a tag `{control}`: -```latte .{file:app/Presenters/templates/Home/default.latte} +```latte .{file:app/UI/Home/default.latte}

Registration

{control registrationForm} diff --git a/forms/ro/in-presenter.texy b/forms/ro/in-presenter.texy index 86b61b0e37..e191ef2786 100644 --- a/forms/ro/in-presenter.texy +++ b/forms/ro/in-presenter.texy @@ -30,7 +30,7 @@ Formularul din prezentator este un obiect din clasa `Nette\Application\UI\Form`, Din punctul de vedere al prezentatorului, formularul este o componentă comună. Prin urmare, acesta este tratat ca o componentă și încorporat în prezentator folosind [metoda factory |application:components#Factory Methods]. Acesta va arăta astfel: -```php .{file:app/Presenters/HomePresenter.php} +```php .{file:app/UI/Home/HomePresenter.php} use Nette; use Nette\Application\UI\Form; @@ -59,7 +59,7 @@ class HomePresenter extends Nette\Application\UI\Presenter Iar redarea în șablon se face cu ajutorul etichetei `{control}`: -```latte .{file:app/Presenters/templates/Home/default.latte} +```latte .{file:app/UI/Home/default.latte}

Registration

{control registrationForm} diff --git a/forms/ru/in-presenter.texy b/forms/ru/in-presenter.texy index ff2fa742cf..4f4992658b 100644 --- a/forms/ru/in-presenter.texy +++ b/forms/ru/in-presenter.texy @@ -30,7 +30,7 @@ $form->onSuccess[] = [$this, 'formSucceeded']; С точки зрения презентера форма является общим компонентом. Поэтому она рассматривается как компонент и включается в презентер с помощью [фабричного метода |application:components#Factory-Methods]. Это будет выглядеть следующим образом: -```php .{file:app/Presenters/HomePresenter.php} +```php .{file:app/UI/Home/HomePresenter.php} use Nette; use Nette\Application\UI\Form; @@ -59,7 +59,7 @@ class HomePresenter extends Nette\Application\UI\Presenter А рендеринг в шаблоне осуществляется с помощью тега `{control}`: -```latte .{file:app/Presenters/templates/Home/default.latte} +```latte .{file:app/UI/Home/default.latte}

Регистрация

{control registrationForm} diff --git a/forms/sl/in-presenter.texy b/forms/sl/in-presenter.texy index 807a389a7a..229bee3900 100644 --- a/forms/sl/in-presenter.texy +++ b/forms/sl/in-presenter.texy @@ -30,7 +30,7 @@ Obrazec v predstavitvi je objekt razreda `Nette\Application\UI\Form`, njegov pre Z vidika predstavnika je obrazec skupna komponenta. Zato ga obravnavamo kot komponento in ga vključimo v predstavitveni program z uporabo [tovarniške metode |application:components#Factory Methods]. To bo videti takole: -```php .{file:app/Presenters/HomePresenter.php} +```php .{file:app/UI/Home/HomePresenter.php} use Nette; use Nette\Application\UI\Form; @@ -59,7 +59,7 @@ class HomePresenter extends Nette\Application\UI\Presenter Prikaz v predlogi pa se izvede z uporabo oznake `{control}`: -```latte .{file:app/Presenters/templates/Home/default.latte} +```latte .{file:app/UI/Home/default.latte}

Registration

{control registrationForm} diff --git a/forms/tr/in-presenter.texy b/forms/tr/in-presenter.texy index 09764a3ad0..9a384a6600 100644 --- a/forms/tr/in-presenter.texy +++ b/forms/tr/in-presenter.texy @@ -30,7 +30,7 @@ Sunucudaki form `Nette\Application\UI\Form` sınıfının bir nesnesidir, selefi Sunucunun bakış açısından, form ortak bir bileşendir. Bu nedenle, bir bileşen olarak ele alınır ve [fabrika yöntemi |application:components#Factory Methods] kullanılarak sunucuya dahil edilir. Bu şekilde görünecektir: -```php .{file:app/Presenters/HomePresenter.php} +```php .{file:app/UI/Home/HomePresenter.php} use Nette; use Nette\Application\UI\Form; @@ -59,7 +59,7 @@ class HomePresenter extends Nette\Application\UI\Presenter Ve şablonda render işlemi `{control}` etiketi kullanılarak yapılır: -```latte .{file:app/Presenters/templates/Home/default.latte} +```latte .{file:app/UI/Home/default.latte}

Registration

{control registrationForm} diff --git a/forms/uk/in-presenter.texy b/forms/uk/in-presenter.texy index de72fb81d7..34d1e2e401 100644 --- a/forms/uk/in-presenter.texy +++ b/forms/uk/in-presenter.texy @@ -30,7 +30,7 @@ $form->onSuccess[] = [$this, 'formSucceeded']; З точки зору презентера форма є загальним компонентом. Тому вона розглядається як компонент і включається в презентер за допомогою [фабричного методу |application:components#Factory-Methods]. Це виглядатиме наступним чином: -```php .{file:app/Presenters/HomePresenter.php} +```php .{file:app/UI/Home/HomePresenter.php} use Nette; use Nette\Application\UI\Form; @@ -59,7 +59,7 @@ class HomePresenter extends Nette\Application\UI\Presenter А рендеринг у шаблоні здійснюється за допомогою тега `{control}`: -```latte .{file:app/Presenters/templates/Home/default.latte} +```latte .{file:app/UI/Home/default.latte}

Регистрация

{control registrationForm} diff --git a/quickstart/bg/@home.texy b/quickstart/bg/@home.texy index 6a69c02c80..6afd278c97 100644 --- a/quickstart/bg/@home.texy +++ b/quickstart/bg/@home.texy @@ -67,7 +67,7 @@ http://localhost/nette-blog/www/ Почистване .[#toc-cleanup] ========================== -Уеб проектът съдържа начална страница, която можем да премахнем - не се колебайте да замените съдържанието на файла `app/Presenters/templates/Home/default.latte` с текста `Hello world!`. +Уеб проектът съдържа начална страница, която можем да премахнем - не се колебайте да замените съдържанието на файла `app/UI/Home/default.latte` с текста `Hello world!`. [* qs-hello.webp .{url:-} *] @@ -76,9 +76,9 @@ http://localhost/nette-blog/www/ Tracy (дебъгер) .[#toc-tracy-debugger] ====================================== -Изключително важен инструмент за разработка е [дебъгер, наречен Tracy. |tracy:] Опитайте се да направите някои грешки във вашия файл `app/Presenters/HomePresenter.php` (например да премахнете къдравата скоба от дефиницията на класа HomePresenter) и вижте какво ще се случи. Ще се появи страница с червен екран и разбираемо описание на грешката. +Изключително важен инструмент за разработка е [дебъгер, наречен Tracy. |tracy:] Опитайте се да направите някои грешки във вашия файл `app/UI/Home/HomePresenter.php` (например да премахнете къдравата скоба от дефиницията на класа HomePresenter) и вижте какво ще се случи. Ще се появи страница с червен екран и разбираемо описание на грешката. -[* qs-tracy.webp .{url:-}(debugger screen) *] +[* qs-tracy.avif .{url:-}(debugger screen) *] Трейси ще ви помогне значително да откриете грешките. Обърнете внимание и на плаващата лента Tracy Bar в долния десен ъгъл, която ви информира за важни данни по време на работа. diff --git a/quickstart/bg/authentication.texy b/quickstart/bg/authentication.texy index 4950637a2b..81d340662e 100644 --- a/quickstart/bg/authentication.texy +++ b/quickstart/bg/authentication.texy @@ -28,9 +28,9 @@ Nette автоматично ще създаде услуга в контейн Нека започнем с формата за вход. Вече знаете как работят формулярите в програмата Presenter. Създайте `SignPresenter` и метод `createComponentSignInForm`. Това трябва да изглежда по следния начин: -```php .{file:app/Presenters/SignPresenter.php} +```php .{file:app/UI/Sign/SignPresenter.php} Войти @@ -77,7 +77,7 @@ final class SignPresenter extends Nette\Application\UI\Presenter Обслужващият модул просто взема потребителското име и паролата, които потребителят е въвел, и ги предава на удостоверителя. След като влезете в системата, ще ви пренасочим към началната страница: -```php .{file:app/Presenters/SignPresenter.php} +```php .{file:app/UI/Sign/SignPresenter.php} private function signInFormSucceeded(Form $form, \stdClass $data): void { try { @@ -102,7 +102,7 @@ private function signInFormSucceeded(Form $form, \stdClass $data): void Ще създадем метод `startup()`, който се изпълнява веднага в началото на [жизнения цикъл на презентатора |application:presenters#Life-Cycle-of-Presenter]. Това пренасочва нерегистрираните потребители към формата за вход. -```php .{file:app/Presenters/EditPresenter.php} +```php .{file:app/UI/Edit/EditPresenter.php} public function startup(): void { parent::startup(); @@ -117,7 +117,7 @@ public function startup(): void Скриване на връзки .[#toc-hide-links] ------------------------------------- -Неоторизиран потребител вече не може да вижда страниците за създаване и редактиране, но все още може да вижда връзките, които сочат към тях. Нека скрием и тях. Една такава връзка се намира на адрес `app/Presenters/templates/Home/default.latte`, като тя трябва да бъде видима само ако потребителят е влязъл в системата. +Неоторизиран потребител вече не може да вижда страниците за създаване и редактиране, но все още може да вижда връзките, които сочат към тях. Нека скрием и тях. Една такава връзка се намира на адрес `app/UI/Home/default.latte`, като тя трябва да бъде видима само ако потребителят е влязъл в системата. Можем да го скрием, като използваме *n:атрибута*, наречен `n:if`. Ако изявлението в него е `false`, тогава целият таг `` и съдържанието му няма да бъде показано: @@ -131,15 +131,15 @@ public function startup(): void {if $user->isLoggedIn()}Создать пост{/if} ``` -По същия начин скрийте връзката за редактиране, намираща се на адрес `app/Presenters/templates/Post/show.latte`. +По същия начин скрийте връзката за редактиране, намираща се на адрес `app/UI/Post/show.latte`. Връзка към формуляра за влизане .[#toc-login-form-link] ======================================================= -Здравейте, но как да стигнем до страницата за вход? Няма връзка, която да сочи към него. Нека да го добавим към файла с шаблона `app/Presenters/templates/@layout.latte`. Опитайте се да намерите добро място, може да е всяко място, което ви харесва най-много. +Здравейте, но как да стигнем до страницата за вход? Няма връзка, която да сочи към него. Нека да го добавим към файла с шаблона `app/UI/@layout.latte`. Опитайте се да намерите добро място, може да е всяко място, което ви харесва най-много. -```latte .{file:app/Presenters/templates/@layout.latte} +```latte .{file:app/UI/@layout.latte} ...