Skip to content
This repository has been archived by the owner on Dec 30, 2023. It is now read-only.

Commit

Permalink
New Crowdin updates (#2845)
Browse files Browse the repository at this point in the history
* New translations http-uri.md (Spanish)

* New translations routing.md (Bulgarian)

* New translations db-models-relationships.md (Bulgarian)

* New translations http-uri.md (Bulgarian)

* New translations tutorial-rest-advanced.md (Bulgarian)

* New translations routing.md (Czech)

* New translations db-models-relationships.md (Czech)

* New translations tutorial-rest-advanced.md (Spanish)

* New translations db-models-relationships.md (French)

* New translations routing.md (Spanish)

* New translations http-uri.md (French)

* New translations routing.md (French)

* New translations db-models-relationships.md (Spanish)

* New translations tutorial-rest-advanced.md (French)

* New translations tutorial-rest-advanced.md (Greek)

* New translations http-uri.md (Greek)

* New translations db-models-relationships.md (Italian)

* New translations tutorial-rest-advanced.md (Italian)

* New translations http-uri.md (Italian)

* New translations db-models-relationships.md (Japanese)

* New translations routing.md (Italian)

* New translations routing.md (German)

* New translations db-models-relationships.md (German)

* New translations http-uri.md (Czech)

* New translations tutorial-rest-advanced.md (Czech)

* New translations db-models-relationships.md (Greek)

* New translations routing.md (Greek)

* New translations http-uri.md (German)

* New translations tutorial-rest-advanced.md (German)

* New translations http-uri.md (Dutch)

* New translations tutorial-rest-advanced.md (Dutch)

* New translations db-models-relationships.md (Polish)

* New translations db-models-relationships.md (Dutch)

* New translations routing.md (Dutch)

* New translations routing.md (Polish)

* New translations routing.md (Russian)

* New translations db-models-relationships.md (Russian)

* New translations http-uri.md (Polish)

* New translations tutorial-rest-advanced.md (Polish)

* New translations db-models-relationships.md (Korean)

* New translations tutorial-rest-advanced.md (Japanese)

* New translations routing.md (Korean)

* New translations http-uri.md (Japanese)

* New translations routing.md (Japanese)

* New translations routing.md (Mongolian)

* New translations http-uri.md (Mongolian)

* New translations tutorial-rest-advanced.md (Mongolian)

* New translations http-uri.md (Korean)

* New translations tutorial-rest-advanced.md (Korean)

* New translations db-models-relationships.md (Mongolian)

* New translations db-models-relationships.md (Turkish)

* New translations tutorial-rest-advanced.md (Serbian (Cyrillic))

* New translations http-uri.md (Serbian (Cyrillic))

* New translations routing.md (Turkish)

* New translations db-models-relationships.md (Serbian (Cyrillic))

* New translations tutorial-rest-advanced.md (Russian)

* New translations http-uri.md (Russian)

* New translations routing.md (Serbian (Cyrillic))

* New translations http-uri.md (Indonesian)

* New translations tutorial-rest-advanced.md (Indonesian)

* New translations routing.md (Persian)

* New translations db-models-relationships.md (Persian)

* New translations db-models-relationships.md (Indonesian)

* New translations http-uri.md (Portuguese, Brazilian)

* New translations tutorial-rest-advanced.md (Portuguese, Brazilian)

* New translations routing.md (Indonesian)

* New translations routing.md (Thai)

* New translations http-uri.md (Thai)

* New translations tutorial-rest-advanced.md (Thai)

* New translations db-models-relationships.md (Thai)

* New translations http-uri.md (Persian)

* New translations tutorial-rest-advanced.md (Persian)

* New translations http-uri.md (Ukrainian)

* New translations tutorial-rest-advanced.md (Ukrainian)

* New translations db-models-relationships.md (Chinese Simplified)

* New translations routing.md (Chinese Simplified)

* New translations db-models-relationships.md (Ukrainian)

* New translations http-uri.md (Turkish)

* New translations tutorial-rest-advanced.md (Turkish)

* New translations routing.md (Ukrainian)

* New translations routing.md (Portuguese, Brazilian)

* New translations db-models-relationships.md (Portuguese, Brazilian)

* New translations tutorial-rest-advanced.md (Chinese Simplified)

* New translations http-uri.md (Chinese Simplified)
  • Loading branch information
niden committed Apr 9, 2021
1 parent b96e943 commit e9eec5c
Show file tree
Hide file tree
Showing 84 changed files with 1,129 additions and 688 deletions.
23 changes: 23 additions & 0 deletions bg-bg/db-models-relationships.md
Expand Up @@ -319,6 +319,8 @@ Depending on the needs of our application we might want to store data in one tab

Using relationships, you can get only those `Customers` that relate to our `Invoices` that have a certain `cst_status_flag`. Defining that constraint in the relationship allows you to let the model do all the work.

It also accepts a closure, which is evaluated every time before the related records are accessed. This enables the conditions to be automatically updated between queries.

```php
<?php

Expand Down Expand Up @@ -352,6 +354,27 @@ class Invoices extends Model
]
]
);

$container = $this->getDI();

$this->hasMany(
'inv_cst_id',
Customers::class,
'cst_id',
[
'reusable' => true,
'alias' => 'customersNearby',
'params' => function() use ($container) {
return [
'conditions' => 'cst_location = :location:',
'bind' => [
// Location can change between queries
'location' => $container->getShared('myLocationService')->myLocation,
]
];
}
]
);
}
}
```
Expand Down
34 changes: 17 additions & 17 deletions bg-bg/http-uri.md
Expand Up @@ -22,7 +22,7 @@ The [Phalcon\Http\Message\Uri](api/phalcon_http#http-message-uri) returns a valu
use Phalcon\Http\Message\Uri;

$query = 'https://usr:pass@d.phalcon.ld:8080/action?par=val#frag';
$uri = new Uri();
$uri = new Uri($query);

echo $uri->getHost(); // 'd.phalcon.ld'
```
Expand Down Expand Up @@ -50,7 +50,7 @@ Returns the string representation of the URI. Depending on which components of t
use Phalcon\Http\Message\Uri;

$query = 'https://usr:pass@d.phalcon.ld:8080/action?par=val#frag';
$uri = new Uri();
$uri = new Uri($query);

echo (string) $uri;
// 'https://usr:pass@d.phalcon.ld:8080/action?par=val#frag'
Expand All @@ -72,7 +72,7 @@ If the port is not set, or is one of the standard for the scheme, it will not be
use Phalcon\Http\Message\Uri;

$query = 'https://usr:pass@d.phalcon.ld:8080/action?par=val#frag';
$uri = new Uri();
$uri = new Uri($query);

echo $uri->getAuthority(); // 'usr:pass@d.phalcon.ld:8080'
```
Expand All @@ -87,7 +87,7 @@ Returns a string representing the fragment of the URI. If no fragment is present
use Phalcon\Http\Message\Uri;

$query = 'https://usr:pass@d.phalcon.ld:8080/action?par=val#frag';
$uri = new Uri();
$uri = new Uri($query);

echo $uri->getFragment(); // 'frag'
```
Expand All @@ -102,7 +102,7 @@ Returns a string representing the host component of the URI. If no host is prese
use Phalcon\Http\Message\Uri;

$query = 'https://usr:pass@d.phalcon.ld:8080/action?par=val#frag';
$uri = new Uri();
$uri = new Uri($query);

echo $uri->getHost(); // 'd.phalcon.ld'
```
Expand All @@ -117,7 +117,7 @@ Returns a string representing the path component of the URI. The path can either
use Phalcon\Http\Message\Uri;

$query = 'https://usr:pass@d.phalcon.ld:8080/action?par=val#frag';
$uri = new Uri();
$uri = new Uri($query);

echo $uri->getPath(); // '/action'
```
Expand All @@ -132,7 +132,7 @@ Returns an integer representing the port component of the URI. If the port is pr
use Phalcon\Http\Message\Uri;

$query = 'https://usr:pass@d.phalcon.ld:8080/action?par=val#frag';
$uri = new Uri();
$uri = new Uri($query);

echo $uri->getPort(); // 8080
```
Expand All @@ -147,7 +147,7 @@ Returns a string representing the query of the URI. If no query is present, an e
use Phalcon\Http\Message\Uri;

$query = 'https://usr:pass@d.phalcon.ld:8080/action?par=val#frag';
$uri = new Uri();
$uri = new Uri($query);

echo $uri->getQuery(); // '/par=val'
```
Expand All @@ -162,7 +162,7 @@ Returns a string representing the scheme of the URI. If the scheme is not presen
use Phalcon\Http\Message\Uri;

$query = 'https://usr:pass@d.phalcon.ld:8080/action?par=val#frag';
$uri = new Uri();
$uri = new Uri($query);

echo $uri->getScheme(); // 'https'
```
Expand All @@ -177,7 +177,7 @@ Returns a string representation of the user information of the URI. If no user i
use Phalcon\Http\Message\Uri;

$query = 'https://usr:pass@d.phalcon.ld:8080/action?par=val#frag';
$uri = new Uri();
$uri = new Uri($query);

echo $uri->getUserInfo(); // 'usr:pass'
```
Expand All @@ -195,7 +195,7 @@ Returns an instance with the new fragment. An empty fragment supplied will remov
use Phalcon\Http\Message\Uri;

$query = 'https://usr:pass@d.phalcon.ld:8080/action?par=val#frag';
$uri = new Uri();
$uri = new Uri($query);

echo $uri->getFragment(); // 'frag'

Expand All @@ -214,7 +214,7 @@ Returns an instance with the new host. An empty host supplied will remove the ho
use Phalcon\Http\Message\Uri;

$query = 'https://usr:pass@d.phalcon.ld:8080/action?par=val#frag';
$uri = new Uri();
$uri = new Uri($query);

echo $uri->getHost(); // 'd.phalcon.ld'

Expand All @@ -233,7 +233,7 @@ Returns an instance with the new path. An empty path supplied will remove the pa
use Phalcon\Http\Message\Uri;

$query = 'https://usr:pass@d.phalcon.ld:8080/action?par=val#frag';
$uri = new Uri();
$uri = new Uri($query);

echo $uri->getPath(); // '/action'

Expand All @@ -252,7 +252,7 @@ Returns an instance with the new port. A `null` port supplied will remove the po
use Phalcon\Http\Message\Uri;

$query = 'https://usr:pass@d.phalcon.ld:8080/action?par=val#frag';
$uri = new Uri();
$uri = new Uri($query);

echo $uri->getPort(); // 8080

Expand All @@ -271,7 +271,7 @@ Returns an instance with the new query. An empty query supplied will remove the
use Phalcon\Http\Message\Uri;

$query = 'https://usr:pass@d.phalcon.ld:8080/action?par=val#frag';
$uri = new Uri();
$uri = new Uri($query);

echo $uri->getQuery(); // 'par=val'

Expand All @@ -290,7 +290,7 @@ Returns an instance with the new scheme. An empty scheme supplied will remove th
use Phalcon\Http\Message\Uri;

$query = 'https://usr:pass@d.phalcon.ld:8080/action?par=val#frag';
$uri = new Uri();
$uri = new Uri($query);

echo $uri->getScheme(); // 'https'

Expand All @@ -309,7 +309,7 @@ Returns an instance with the new user information. The password is optional. If
use Phalcon\Http\Message\Uri;

$query = 'https://usr:pass@d.phalcon.ld:8080/action?par=val#frag';
$uri = new Uri();
$uri = new Uri($query);

echo $uri->getUserInfo(); // 'usr:pass'

Expand Down
12 changes: 6 additions & 6 deletions bg-bg/routing.md
Expand Up @@ -35,10 +35,11 @@ $router->add(
$router->handle(
$_SERVER["REQUEST_URI"]
);
````
```

## Constants
There are two constants available for the [Phalcon\Mvc\Router][mvc-router] component that are used to define the position of the route in the processing stack.

There are two constants available for the [Phalcon\Mvc\Router](api/phalcon_mvc#mvc-router) component that are used to define the position of the route in the processing stack.

- `POSITION_FIRST`
- `POSITION_LAST`
Expand Down Expand Up @@ -401,12 +402,11 @@ $router->add(
$router->handle(
$_SERVER["REQUEST_URI"]
);
````

```

The first parameter of the `add()` method is the pattern you want to match and, optionally, the second parameter is a set of paths. In the above example, for the URI `/admin/invoices/list`, the `InvoicesController` will be loaded and the `listAction` will be called. It is important to remember that the router does not execute the controller and action, it only collects this information and then forwards it to the [Phalcon\Mvc\Dispatcher](dispatcher) which executes them.

An application can have many paths and defining routes one by one can be a cumbersome task. [Phalcon\Mvc\Router][mvc-router] offers an easier way to register routes.
An application can have many paths and defining routes one by one can be a cumbersome task. [Phalcon\Mvc\Router](api/phalcon_mvc#mvc-router) offers an easier way to register routes.

```php
<?php
Expand Down Expand Up @@ -1059,7 +1059,7 @@ $route->beforeMatch(
);
```

The above will check if the request has been made with AJAX and return false if it was not
The above will check if the request has been made with AJAX and return `false` if it was not

You can create a filter class, to allow you to inject the same functionality in different routes.

Expand Down
8 changes: 3 additions & 5 deletions bg-bg/tutorial-rest-advanced.md
Expand Up @@ -212,7 +212,7 @@ Our API provides information about `robots`, these data are stored in a database
namespace Store\Toys;

use Phalcon\Mvc\Model;
use Phalcon\Mvc\Model\Message;
use Phalcon\Messages\Message;
use Phalcon\Validation;
use Phalcon\Validation\Validator\Uniqueness;
use Phalcon\Validation\Validator\InclusionIn;
Expand Down Expand Up @@ -256,10 +256,8 @@ class Robots extends Model
);
}

// Check if any messages have been produced
if ($this->validationHasFailed() === true) {
return false;
}
// Validate the valididator
return $this->validate($validator);
}
}
```
Expand Down
23 changes: 23 additions & 0 deletions cs-cz/db-models-relationships.md
Expand Up @@ -319,6 +319,8 @@ Depending on the needs of our application we might want to store data in one tab

Using relationships, you can get only those `Customers` that relate to our `Invoices` that have a certain `cst_status_flag`. Defining that constraint in the relationship allows you to let the model do all the work.

It also accepts a closure, which is evaluated every time before the related records are accessed. This enables the conditions to be automatically updated between queries.

```php
<?php

Expand Down Expand Up @@ -352,6 +354,27 @@ class Invoices extends Model
]
]
);

$container = $this->getDI();

$this->hasMany(
'inv_cst_id',
Customers::class,
'cst_id',
[
'reusable' => true,
'alias' => 'customersNearby',
'params' => function() use ($container) {
return [
'conditions' => 'cst_location = :location:',
'bind' => [
// Location can change between queries
'location' => $container->getShared('myLocationService')->myLocation,
]
];
}
]
);
}
}
```
Expand Down

0 comments on commit e9eec5c

Please sign in to comment.