Skip to content

Commit 3f72a3a

Browse files
committed
components updates for 2.5
1 parent 76bbe64 commit 3f72a3a

File tree

97 files changed

+4541
-1678
lines changed

Some content is hidden

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

97 files changed

+4541
-1678
lines changed

book/routing.rst

Lines changed: 71 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -445,10 +445,10 @@ ujemal in dajal parametru ``page`` vrednost ``2``. Odlično.
445445
.. index::
446446
single: Routing; Requirements
447447

448-
Adding Requirements
449-
~~~~~~~~~~~~~~~~~~~
448+
Dodajanje zahtev
449+
~~~~~~~~~~~~~~~~
450450

451-
Take a quick look at the routes that have been created so far:
451+
Na hitro poglejte usmeritve, ki so bile ustvarjene za vas:
452452

453453
.. configuration-block::
454454

@@ -497,26 +497,26 @@ Take a quick look at the routes that have been created so far:
497497
498498
return $collection;
499499
500-
Can you spot the problem? Notice that both routes have patterns that match
501-
URL's that look like ``/blog/*``. The Symfony router will always choose the
502-
**first** matching route it finds. In other words, the ``blog_show`` route
503-
will *never* be matched. Instead, a URL like ``/blog/my-blog-post`` will match
504-
the first route (``blog``) and return a nonsense value of ``my-blog-post``
505-
to the ``{page}`` parameter.
506-
507-
+--------------------+-------+-----------------------+
508-
| URL | route | parameters |
509-
+====================+=======+=======================+
510-
| /blog/2 | blog | {page} = 2 |
511-
+--------------------+-------+-----------------------+
512-
| /blog/my-blog-post | blog | {page} = my-blog-post |
513-
+--------------------+-------+-----------------------+
514-
515-
The answer to the problem is to add route *requirements* or route *conditions*
516-
(see :ref:`book-routing-conditions`). The routes in this example would work
517-
perfectly if the ``/blog/{page}`` path *only* matched URLs where the ``{page}``
518-
portion is an integer. Fortunately, regular expression requirements can easily
519-
be added for each parameter. For example:
500+
Ali opazite problem? Bodite pozorni, da imata obe usmeritvi vzorce, ki se ujemajo
501+
z URL-ji, ki izgledajo kot ``/blog/*``. Symfony-jev usmerjevalnik bo vedno izbral
502+
**prvo** ujemalno usmeritev, ki jo najde. Z drugimi besedami, usmeritev ``blog_show``
503+
se ne bo nikoli ujemala. Namesto tega, URL kot je ``/blog/my-blog-post`` se bo ujel
504+
s prvo usmeritvijo (``blog``) in vrnil nesmiselno vrednost ``my-blog-post``
505+
parametru ``{page}``.
506+
507+
+--------------------+-----------+-----------------------+
508+
| URL | usmeritev | parametri |
509+
+====================+===========+=======================+
510+
| /blog/2 | blog | {page} = 2 |
511+
+--------------------+-----------+-----------------------+
512+
| /blog/my-blog-post | blog | {page} = my-blog-post |
513+
+--------------------+-----------+-----------------------+
514+
515+
Odgovor na problem je dodati *zahteve* usmeritve ali *pogoje* usmeritve
516+
(see :ref:`book-routing-conditions`). Usmeritve v tem primeru bi delovale
517+
odlično, če bi se pot ``/blog/{page}`` ujemala *samo* z URL-ji, kjer je del
518+
``{page}`` celo število. Na srečo, so lahko zahteve splošnih izrazov enostavno
519+
dodane za vsak parameter. Na primer:
520520

521521
.. configuration-block::
522522

@@ -558,17 +558,17 @@ be added for each parameter. For example:
558558
559559
return $collection;
560560
561-
The ``\d+`` requirement is a regular expression that says that the value of
562-
the ``{page}`` parameter must be a digit (i.e. a number). The ``blog`` route
563-
will still match on a URL like ``/blog/2`` (because 2 is a number), but it
564-
will no longer match a URL like ``/blog/my-blog-post`` (because ``my-blog-post``
565-
is *not* a number).
561+
Zahteva ``\d+`` je splošni izraz, ki pravi, da vrednost
562+
parametra ``{page}`` mora biti celo število (t.j. številka). Usmeritev ``blog``
563+
se bo še vedno ujemala na URL-jih kot je ``/blog/2`` (ker je 2 številka), vendar
564+
se ne bo več ujemala z URL-ji kot je ``/blog/my-blog-post`` (ker ``my-blog-post``
565+
*ni* številka).
566566

567-
As a result, a URL like ``/blog/my-blog-post`` will now properly match the
568-
``blog_show`` route.
567+
Kot rezultat, URL kot je ``/blog/my-blog-post``, se bo sedaj ustrezno ujemala z
568+
usmeritvijo ``blog_show``.
569569

570570
+----------------------+-----------+-------------------------+
571-
| URL | route | parameters |
571+
| URL | usmeritev | parametri |
572572
+======================+===========+=========================+
573573
| /blog/2 | blog | {page} = 2 |
574574
+----------------------+-----------+-------------------------+
@@ -577,18 +577,18 @@ As a result, a URL like ``/blog/my-blog-post`` will now properly match the
577577
| /blog/2-my-blog-post | blog_show | {slug} = 2-my-blog-post |
578578
+----------------------+-----------+-------------------------+
579579

580-
.. sidebar:: Earlier Routes always Win
580+
.. sidebar:: Prejšnje usmeritve vedno zmagajo
581581

582-
What this all means is that the order of the routes is very important.
583-
If the ``blog_show`` route were placed above the ``blog`` route, the
584-
URL ``/blog/2`` would match ``blog_show`` instead of ``blog`` since the
585-
``{slug}`` parameter of ``blog_show`` has no requirements. By using proper
586-
ordering and clever requirements, you can accomplish just about anything.
582+
Kaj to vse pomeni je, da je vrstni red usmeritev zelo pomemben.
583+
Če bi bila usmeritev ``blog_show`` postavljena nad usmeritev ``blog``,
584+
bi se URL ``/blog/2`` ujemal z ``blog_show`` namesto z ``blog``, ker
585+
parameter ``{slug}`` od ``blog_show`` nima nobenih zahtev. Z uporabo ustreznega
586+
vrstnega reda in pametnih zahtev, lahko dosežete karkoli.
587587

588-
Since the parameter requirements are regular expressions, the complexity
589-
and flexibility of each requirement is entirely up to you. Suppose the homepage
590-
of your application is available in two different languages, based on the
591-
URL:
588+
Ker so zahteve parametrov splošni izrazi, sta kompleksnost
589+
in fleksibilnost vsakega zahtevka v celoti odvisna od vas. Predpostavimo, da je domača stran
590+
vaše aplikacije na voljo v dveh različnih jezikih, na osnovi
591+
URL-ja:
592592

593593
.. configuration-block::
594594

@@ -630,8 +630,8 @@ URL:
630630
631631
return $collection;
632632
633-
For incoming requests, the ``{culture}`` portion of the URL is matched against
634-
the regular expression ``(en|fr)``.
633+
Za prihajajoče zahtevke, se del ``{culture}`` URL-ja ujema s
634+
splošnimi izrazi ``(en|fr)``.
635635

636636
+-----+--------------------------+
637637
| / | {culture} = en |
@@ -646,14 +646,14 @@ the regular expression ``(en|fr)``.
646646
.. index::
647647
single: Routing; Method requirement
648648

649-
Adding HTTP Method Requirements
650-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
649+
Dodajanje zahtev HTTP metod
650+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
651651

652-
In addition to the URL, you can also match on the *method* of the incoming
653-
request (i.e. GET, HEAD, POST, PUT, DELETE). Suppose you have a contact form
654-
with two controllers - one for displaying the form (on a GET request) and one
655-
for processing the form when it's submitted (on a POST request). This can
656-
be accomplished with the following route configuration:
652+
V dodatku URL-ja, lahko tudi ujemate na *metodi* prihajajočega
653+
zahtevka (t.j. GET, HEAD, POST, PUT, DELETE). Predpostavimo, da imate kontaktni obrazec
654+
z dvema krmilnikoma - eden za prikaz obrazca (na zahtevku GET) in eden
655+
za procesiranje obrazca, ko je poslan (na zahtevku POST). To je lahko
656+
doseženo s sledečo nastavitvijo usmeritve:
657657

658658
.. configuration-block::
659659

@@ -702,33 +702,33 @@ be accomplished with the following route configuration:
702702
703703
return $collection;
704704
705-
Despite the fact that these two routes have identical paths (``/contact``),
706-
the first route will match only GET requests and the second route will match
707-
only POST requests. This means that you can display the form and submit the
708-
form via the same URL, while using distinct controllers for the two actions.
705+
Kljub dejstvu, da imata ti dve usmeritvi identični poti (``/contact``),
706+
se bo prva usmeritev ujemala samo z zahtevki GET in druga usmeritev se bo ujemala
707+
samo z zahtevki POST. To pomeni, da lahko prikažete obrazec in ga pošljete
708+
preko enakega URL-ja, medtem ko uporabljate različna krmilnika za ti dve akciji.
709709

710710
.. note::
711711

712-
If no ``methods`` are specified, the route will match on *all* methods.
712+
Če ni specificirana nobena ``method``, se bo usmeritev ujemala z *vsemi* metodami.
713713

714-
Adding a Host Requirement
715-
~~~~~~~~~~~~~~~~~~~~~~~~~
714+
Dodajanje zahtev gostitelja
715+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
716716

717-
You can also match on the HTTP *host* of the incoming request. For more
718-
information, see :doc:`/components/routing/hostname_pattern` in the Routing
719-
component documentation.
717+
Ujemate lahko tudi HTTP *host* prihajajočega zahtevka. Za več
718+
informacij, glejte :doc:`/components/routing/hostname_pattern` v dokumentaciji Routing
719+
komponente.
720720

721721
.. _book-routing-conditions:
722722

723-
Completely Customized Route Matching with Conditions
724-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
723+
Popolnoma prilagojeno ujemanje usmeritev s pogoji
724+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
725725

726726
.. versionadded:: 2.4
727-
Route conditions were introduced in Symfony 2.4.
727+
Pogoji usmeritev so bili predstavljeni v Symfony 2.4.
728728

729-
As you've seen, a route can be made to match only certain routing wildcards
730-
(via regular expressions), HTTP methods, or host names. But the routing system
731-
can be extended to have an almost infinite flexibility using ``conditions``:
729+
Kot ste videli, je lahko usmeritev narejena, da se ujema samo z določenimi usmeritvenimi nadomestnimi znaki
730+
(preko splošnih izrazov), HTTP metodami ali imeni gostiteljev. Vendar je lahko sistem
731+
usmerjanja razširjen, da ima skoraj neskončno fleksibilnost z uporabo ``pogojev``:
732732

733733
.. configuration-block::
734734

@@ -775,11 +775,12 @@ can be extended to have an almost infinite flexibility using ``conditions``:
775775
776776
return $collection;
777777
778-
The ``condition`` is an expression, and you can learn more about its syntax
779-
here: :doc:`/components/expression_language/syntax`. With this, the route
780-
won't match unless the HTTP method is either GET or HEAD *and* if the ``User-Agent``
781-
header matches ``firefox``.
778+
``condition`` je izraz in lahko se naučite več o njegovi sintaksi
779+
tu: :doc:`/components/expression_language/syntax`. S tem se usmeritev
780+
ne bo ujemala razen, če je HTTP metoda ali GET ali HEAD *in*, če je glava ``User-Agent``
781+
``firefox``.
782782

783+
Lahko naredite katerokoli kompleksno logiko, ki jo potrebujete v izrazu
783784
You can do any complex logic you need in the expression by leveraging two
784785
variables that are passed into the expression:
785786

components/class_loader/cache_class_loader.rst

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
.. index::
22
single: APC; ApcClassLoader
3-
single: Class Loader; ApcClassLoader
4-
single: Class Loader; Cache
5-
single: Class Loader; XcacheClassLoader
3+
single: ClassLoader; ApcClassLoader
4+
single: ClassLoader; Cache
5+
single: ClassLoader; XcacheClassLoader
66
single: XCache; XcacheClassLoader
7-
7+
88
Predpomnenje nalagalnika razredov
99
=================================
1010

1111
Uvod
1212
----
1313

1414
Najti datoteko za določen razred je lahko zahtevno opravilo. Na srečo
15-
komponenta Class Loader prihaja z dvema razredoma za predpomnenje ujemanja
15+
komponenta ClassLoader prihaja z dvema razredoma za predpomnenje ujemanja
1616
iz razreda v njegovo vsebujočo datoteko.
1717
:class:`Symfony\\Component\\ClassLoader\\ApcClassLoader`
1818
in :class:`Symfony\\Component\\ClassLoader\\XcacheClassLoader` se ovijata
@@ -21,8 +21,8 @@ razred.
2121

2222
.. note::
2323

24-
Oba, ``ApcClassLoader`` in ``XcacheClassLoader`` sta lahko uporabljena
25-
za predpomnenje Composer-jevega `autoloader-ja`_.
24+
Oba, ``ApcClassLoader`` in ``XcacheClassLoader`` sta lahko uporabljena
25+
za predpomnenje Composer-jevega `autoloader-ja`_.
2626

2727
ApcClassLoader
2828
--------------
@@ -31,16 +31,16 @@ ApcClassLoader
3131
metodi ``findFile()`` z uporabo `APC`_::
3232

3333
require_once '/path/to/src/Symfony/Component/ClassLoader/ApcClassLoader.php';
34-
34+
3535
// instance of a class that implements a findFile() method, like the ClassLoader
3636
$loader = ...;
37-
38-
// my_prefix is the APC namespace prefix to use
39-
$cachedLoader = new ApcClassLoader('my_prefix', $loader);
40-
37+
38+
// sha1(__FILE__) generates an APC namespace prefix
39+
$cachedLoader = new ApcClassLoader(sha1(__FILE__), $loader);
40+
4141
// register the cached class loader
4242
$cachedLoader->register();
43-
43+
4444
// deactivate the original, non-cached loader if it was registered previously
4545
$loader->unregister();
4646

@@ -51,16 +51,16 @@ XcacheClassLoader
5151
je enostavna::
5252

5353
require_once '/path/to/src/Symfony/Component/ClassLoader/XcacheClassLoader.php';
54-
54+
5555
// instance of a class that implements a findFile() method, like the ClassLoader
5656
$loader = ...;
57-
58-
// my_prefix is the XCache namespace
59-
$cachedLoader = new XcacheClassLoader('my_prefix', $loader);
60-
57+
58+
// sha1(__FILE__) generates an XCache namespace prefix
59+
$cachedLoader = new XcacheClassLoader(sha1(__FILE__), $loader);
60+
6161
// register the cached class loader
6262
$cachedLoader->register();
63-
63+
6464
// deactivate the original, non-cached loader if it was registered previously
6565
$loader->unregister();
6666

components/class_loader/class_loader.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.. index::
2-
single: Class Loader; PSR-0 Class Loader
2+
single: ClassLoader; PSR-0 Class Loader
33

44
PSR-0 Class Loader
55
==================
@@ -28,7 +28,7 @@ je enostavna::
2828
$loader = new ClassLoader();
2929

3030
// to enable searching the include path (eg. for PEAR packages)
31-
$loader->useIncludePath(true);
31+
$loader->setUseIncludePath(true);
3232

3333
// ... register namespaces and prefixes here - see below
3434

@@ -78,4 +78,4 @@ direktorij ``Doctrine`` (zadnji, ki je nastavljen) preden odneha. Vrstni red
7878
registracije predpon je pomemben v tem primeru.
7979

8080
.. _PEAR: http://pear.php.net/manual/en/standards.naming.php
81-
.. _PSR-0: http://symfony.com/PSR0
81+
.. _PSR-0: http://www.php-fig-org/psr/psr-0/
Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
.. index::
2-
single: Class Loader; DebugClassLoader
3-
2+
single: ClassLoader; DebugClassLoader
3+
44
Razhroščevanje komponente Class Loader
55
======================================
66

7-
:class:`Symfony\\Component\\ClassLoader\\DebugClassLoader` poskuša
8-
vrniti več pomagalnih izjem, ko razred ni najden v registriranih
9-
avtomatskih nalagalnikih. Vsi avtomatski nalagalniki, ki implementirajo
10-
metodo ``findFile()`` so zamenjani z ``DebugClassLoader`` ovojem.
11-
12-
Uporaba ``DebugClassLoader`` je tako enostavna kot klicanje njene statične
13-
metode :method:`Symfony\\Component\\ClassLoader\\DebugClassLoader::enable`::
14-
15-
use Symfony\Component\ClassLoader\DebugClassLoader;
16-
17-
DebugClassLoader::enable();
7+
Od Symfony 2.4 je ``DebugClassLoader`` komponente Class Loader
8+
opuščen. Uporabite
9+
:doc:`DebugClassLoader ponujen s strani komponente Debug </components/debug/class_loader>`.

components/class_loader/index.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
Class Loader
1+
ClassLoader
22
============
33

44
.. toctree::
55
:maxdepth: 2
6-
6+
77
introduction
88
class_loader
9+
psr4_class_loader
910
map_class_loader
1011
cache_class_loader
1112
debug_class_loader

components/class_loader/introduction.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
.. index::
2-
single: Components; Class Loader
2+
single: Components; ClassLoader
33

4-
Komponenta Class Loader
4+
Komponenta ClassLoader
55
=======================
66

7-
Komponenta Class Loader Component zagotavlja orodja za avtomatsko nalaganje vaših razredov
7+
Komponenta ClassLoader Component zagotavlja orodja za avtomatsko nalaganje vaših razredov
88
in predpomni njihove lokacije za učinkovitost.
99

1010
Uporaba
@@ -21,7 +21,7 @@ naložiti vaše razrede:
2121
* :doc:`/components/class_loader/map_class_loader`: naloži razrede z uporabo
2222
statičnega zemljevida iz imena razreda v pot datoteke.
2323

24-
Dodatno, Symfony-jeva komponenta Class Loader prihaja s skupkom ovojnih
24+
Dodatno, Symfony-jeva komponenta ClassLoader prihaja s skupkom ovojnih
2525
razredov, ki so lahko uporabljeni za dodajanje dodatnih funkcionalnosti na
2626
vrhu obstoječih avtomatskih nalagalnikov (autoloaders):
2727

0 commit comments

Comments
 (0)