Answer the question
In order to leave comments, you need to log in
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
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 questionAsk a Question
731 491 924 answers to any question