V
V
Voroncheg2019-08-31 13:08:20
Yii
Voroncheg, 2019-08-31 13:08:20

Yii2. How to pass constants from model to form in radiolist?

Everyone will accept. I need to make a radiolist with gender in a form in yii2. Each value must be a constant. How can I do it? Tell me please?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Gomonov, 2019-08-31
@Voroncheg

Directly in the view, you can call Model:: MY_CONST. You can also make a method in the model that returns an array of the necessary constant values, and pass the result to the render method. You can form an array directly in the controller and also in the render. Damn, lots of options.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question