11.. index ::
22 single: Forms; Fields; choice
33
4- choice Field Type
5- =================
6-
7- A multi-purpose field used to allow the user to "choose" one or more options .
8- It can be rendered as a ``select `` tag , radio buttons, or checkboxes .
9-
10- To use this field, you must specify * either * the ``choice_list `` or ``choices ``
11- option .
12-
13- +-------------+------------------------------------------------------------------------------+
14- | Rendered as | can be various tags (see below) |
15- +-------------+------------------------------------------------------------------------------+
16- | Options | - `choices `_ |
17- | | - `choice_list `_ |
18- | | - `multiple `_ |
19- | | - `expanded `_ |
20- | | - `preferred_choices `_ |
21- | | - `empty_value `_ |
22- +-------------+------------------------------------------------------------------------------+
23- | Inherited | - `required `_ |
24- | options | - `label `_ |
25- | | - `read_only `_ |
26- | | - `disabled `_ |
27- | | - `error_bubbling `_ |
28- | | - `error_mapping `_ |
29- | | - `mapped `_ |
30- | | - `inherit_data `_ |
31- | | - `by_reference `_ |
32- | | - `empty_data `_ |
33- +-------------+------------------------------------------------------------------------------+
34- | Parent type | :doc: `form </reference/forms/types/form >` |
35- +-------------+------------------------------------------------------------------------------+
36- | Class | :class: `Symfony\\ Component\\ Form\\ Extension\\ Core\\ Type\\ ChoiceType ` |
37- +-------------+------------------------------------------------------------------------------+
38-
39- Example Usage
40- -------------
41-
42- The easiest way to use this field is to specify the choices directly via the
43- ``choices `` option. The key of the array becomes the value that's actually
44- set on your underlying object (e.g. ``m ``), while the value is what the
45- user sees on the form (e.g . ``Male ``).
4+ choice tip polja
5+ ================
6+
7+ Večnamensko polje uporabljeno za omogočanje uporabniku "izbrati" eno ali več opcij .
8+ Lahko je izpisan kot ``select `` značka , radio button-i ali checkbox-i .
9+
10+ Za uporabo tega polja, morate specificirati * ali * ``choice_list `` ali ``choices ``
11+ opcijo .
12+
13+ +---------------- +------------------------------------------------------------------------------+
14+ | Izpisan kot | lahko so različne značke (glejte spodaj) |
15+ +---------------- +------------------------------------------------------------------------------+
16+ | Opcije | - `choices `_ |
17+ | | - `choice_list `_ |
18+ | | - `multiple `_ |
19+ | | - `expanded `_ |
20+ | | - `preferred_choices `_ |
21+ | | - `empty_value `_ |
22+ +---------------- +------------------------------------------------------------------------------+
23+ | Podedovane | - `required `_ |
24+ | opcije | - `label `_ |
25+ | | - `read_only `_ |
26+ | | - `disabled `_ |
27+ | | - `error_bubbling `_ |
28+ | | - `error_mapping `_ |
29+ | | - `mapped `_ |
30+ | | - `inherit_data `_ |
31+ | | - `by_reference `_ |
32+ | | - `empty_data `_ |
33+ +---------------- +------------------------------------------------------------------------------+
34+ | Starševski tip | :doc: `obrazec </reference/forms/types/form >` |
35+ +---------------- +------------------------------------------------------------------------------+
36+ | Razred | :class: `Symfony\\ Component\\ Form\\ Extension\\ Core\\ Type\\ ChoiceType ` |
37+ +---------------- +------------------------------------------------------------------------------+
38+
39+ Primer uporabe
40+ --------------
41+
42+ Najenostavnejši način za uporabo tega polja je določanje izbir direktno preko
43+ opcije ``choices ``. Ključ polja ( array) postane vrednost, ki je dejansko
44+ nastavljena na vašem osnovnem objektu (npr. ``m ``), medtem ko je vrednost,
45+ kar uporabnik vidi v obrazcu (npr . ``Male ``).
4646
4747.. code-block :: php
4848
@@ -51,9 +51,9 @@ user sees on the form (e.g. ``Male``).
5151 'required' => false,
5252 ));
5353
54- By setting ``multiple `` to true, you can allow the user to choose multiple
55- values. The widget will be rendered as a multiple ``select `` tag or a series
56- of checkboxes depending on the ``expanded `` option :
54+ Z nastavitvijo ``multiple `` na true, lahko dovoljujete uporabniku izbiro večih
55+ vrednosti. Widget bo izpisan kot `` multiple `` ``select `` značka ali serija
56+ potrditvenih polj odvisno od opcije ``expanded ``:
5757
5858.. code-block :: php
5959
@@ -66,24 +66,24 @@ of checkboxes depending on the ``expanded`` option:
6666 'multiple' => true,
6767 ));
6868
69- You can also use the ``choice_list `` option, which takes an object that can
70- specify the choices for your widget.
69+ Lahko tudi uporabite opcijo ``choice_list ``, ki vzame objekt, ki lahko
70+ specificira izbire vašega widget-a .
7171
7272.. _forms-reference-choice-tags :
7373
7474.. include :: /reference/forms/types/options/select_how_rendered.rst.inc
7575
76- Field Options
77- -------------
76+ Opcije polja
77+ ------------
7878
79- choices
80- ~~~~~~~
79+ izbire
80+ ~~~~~~
8181
82- **type **: ``array `` **default **: ``array() ``
82+ **tip **: ``array `` **privzeto **: ``array() ``
8383
84- This is the most basic way to specify the choices that should be used
85- by this field. The ``choices `` option is an array, where the array key
86- is the item value and the array value is the item's label ::
84+ To je najosnovnejši način za določanje izbir, ki bi morale biti uporabljene
85+ na tem polju. Opcija ``choices `` je polje, kjer je ključ polja
86+ element vrednosti in vrednost polja je oznaka elementa ::
8787
8888 $builder->add('gender', 'choice', array(
8989 'choices' => array('m' => 'Male', 'f' => 'Female')
@@ -92,12 +92,12 @@ is the item value and the array value is the item's label::
9292choice_list
9393~~~~~~~~~~~
9494
95- **type **: ``Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface ``
95+ **tip **: ``Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface ``
9696
97- This is one way of specifying the options to be used for this field .
98- The ``choice_list `` option must be an instance of the ``ChoiceListInterface ``.
99- For more advanced cases, a custom class that implements the interface
100- can be created to supply the choices .
97+ To je en način določanja uporabljenih opcij za to polje .
98+ Opcija ``choice_list `` mora biti instanca ``ChoiceListInterface ``.
99+ Za bolj napredne primere, razred po meri, ki implementira vmesnik,
100+ je lahko izdelan za dobavo izbir .
101101
102102.. include :: /reference/forms/types/options/multiple.rst.inc
103103
@@ -107,10 +107,10 @@ can be created to supply the choices.
107107
108108.. include :: /reference/forms/types/options/empty_value.rst.inc
109109
110- Inherited options
110+ Podedovane opcije
111111-----------------
112112
113- These options inherit from the :doc: `form </reference/forms/types/form >` type :
113+ Te opcije dedujejo iz tipa :doc: `obrazec </reference/forms/types/form >`:
114114
115115.. include :: /reference/forms/types/options/required.rst.inc
116116
0 commit comments