Skip to content

Commit

Permalink
new directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Apr 18, 2024
1 parent 8344e4c commit e7af684
Show file tree
Hide file tree
Showing 260 changed files with 1,212 additions and 1,260 deletions.
10 changes: 5 additions & 5 deletions application/bg/routing.texy
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,10 @@ $router->addRoute('index<?.html \.html?|\.php|>', /* ... */);
Интеграция .[#toc-integration]
==============================

За да свържем маршрутизатора си с приложението, трябва да информираме за това контейнера DI. Най-лесният начин е да се подготви фабрика, която ще създаде обект маршрутизатор, и да се каже на конфигурацията на контейнера да го използва. Да предположим, че напишем метод за това, `App\Router\RouterFactory::createRouter()`:
За да свържем маршрутизатора си с приложението, трябва да информираме за това контейнера DI. Най-лесният начин е да се подготви фабрика, която ще създаде обект маршрутизатор, и да се каже на конфигурацията на контейнера да го използва. Да предположим, че напишем метод за това, `App\Core\RouterFactory::createRouter()`:

```php
namespace App\Router;
namespace App\Core

use Nette\Application\Routers\RouteList;

Expand All @@ -499,7 +499,7 @@ class RouterFactory

```neon
services:
- App\Router\RouterFactory::createRouter
- App\Core\RouterFactory::createRouter
```

Всички зависимости, като например връзки към бази данни и т.н., се предават на метода на фабриката като параметри, като се използва [автоматично свързване |dependency-injection:autowiring]:
Expand Down Expand Up @@ -663,7 +663,7 @@ $router->addRoute(/* ... */);
Затова отново ще добавим метод, който ще създаде например маршрутизатор:

```php
namespace App\Router;
namespace App\Core;

use Nette\Routing\RouteList;

Expand Down Expand Up @@ -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();
```

Expand Down
6 changes: 3 additions & 3 deletions application/bg/templates.texy
Original file line number Diff line number Diff line change
Expand Up @@ -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}
...
```

Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -214,7 +214,7 @@ final class LatteExtension extends Latte\Extension
```neon
latte:
extensions:
- App\Templating\LatteExtension
- App\UI\Accessory\LatteExtension
```


Expand Down
10 changes: 5 additions & 5 deletions application/cs/routing.texy
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,10 @@ $router->addRoute('index<?.html \.html?|\.php|>', /* ... */);
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;

Expand All @@ -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]:
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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();
```

Expand Down
6 changes: 3 additions & 3 deletions application/cs/templates.texy
Original file line number Diff line number Diff line change
Expand Up @@ -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}
...
```

Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -214,7 +214,7 @@ Zaregistrujeme ji pomocí [konfigurace |configuration#Šablony Latte]:
```neon
latte:
extensions:
- App\Templating\LatteExtension
- App\UI\Accessory\LatteExtension
```


Expand Down
10 changes: 5 additions & 5 deletions application/de/routing.texy
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,10 @@ $router->addRoute('index<?.html \.html?|\.php|>', /* ... */);
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;

Expand All @@ -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:
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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();
```

Expand Down
6 changes: 3 additions & 3 deletions application/de/templates.texy
Original file line number Diff line number Diff line change
Expand Up @@ -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}
...
```

Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -214,7 +214,7 @@ Wir registrieren sie mit [configuration |configuration#Latte]:
```neon
latte:
extensions:
- App\Templating\LatteExtension
- App\UI\Accessory\LatteExtension
```


Expand Down
10 changes: 5 additions & 5 deletions application/el/routing.texy
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,10 @@ $router->addRoute('index<?.html \.html?|\.php|>', /* ... */);
Ενσωμάτωση .[#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;

Expand All @@ -499,7 +499,7 @@ class RouterFactory

```neon
services:
- App\Router\RouterFactory::createRouter
- App\Core\RouterFactory::createRouter
```

Οποιεσδήποτε εξαρτήσεις, όπως μια σύνδεση βάσης δεδομένων κ.λπ., περνούν στη μέθοδο factory ως παράμετροι με τη χρήση [αυτόματης σύνδεσης |dependency-injection:autowiring]:
Expand Down Expand Up @@ -663,7 +663,7 @@ $router->addRoute(/* ... */);
Έτσι και πάλι θα δημιουργήσουμε μια μέθοδο που θα κατασκευάσει ένα δρομολογητή, για παράδειγμα:

```php
namespace App\Router;
namespace App\Core;

use Nette\Routing\RouteList;

Expand Down Expand Up @@ -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();
```

Expand Down
6 changes: 3 additions & 3 deletions application/el/templates.texy
Original file line number Diff line number Diff line change
Expand Up @@ -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}
...
```

Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -214,7 +214,7 @@ final class LatteExtension extends Latte\Extension
```neon
latte:
extensions:
- App\Templating\LatteExtension
- App\UI\Accessory\LatteExtension
```


Expand Down
10 changes: 5 additions & 5 deletions application/en/routing.texy
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,10 @@ $router->addRoute('index<?.html \.html?|\.php|>', /* ... */);
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;

Expand All @@ -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]:
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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();
```

Expand Down
6 changes: 3 additions & 3 deletions application/en/templates.texy
Original file line number Diff line number Diff line change
Expand Up @@ -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}
...
```

Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -214,7 +214,7 @@ We register it using [configuration#Latte]:
```neon
latte:
extensions:
- App\Templating\LatteExtension
- App\UI\Accessory\LatteExtension
```


Expand Down
10 changes: 5 additions & 5 deletions application/es/routing.texy
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,10 @@ $router->addRoute('index<?.html \.html?|\.php|>', /* ... */);
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;

Expand All @@ -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]:
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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();
```

Expand Down
Loading

0 comments on commit e7af684

Please sign in to comment.