Yii implements the CheckBox check box Display Method in the same line, yiicheckbox
This example describes how to display the CheckBox check box in the same row in yii. Share it with you for your reference. The specific implementation method is as follows:
Yii enables CheckBoxList to output a line break by default, and a checkbox is replaced by a line. In this way, some settings are not required. Next we will implement yii to display the CheckBoxList in the same line.
The checkBoxList of Yii is a column, as shown in:
Someone said on the Internet
Copy codeThe Code is as follows: $ form-> checkBoxList ($ model, 'like', array (1 => 'basketball ', 2 => 'badminton', 3 => 'music '), array ('template' => '<span class = "check"> {input} {label} </span>', 'paramator' => '')
This can be achieved, but I found that the effect is still not good. I hope you will not use this line any more.
My solution isUse checkBoxListInlineRow of yiibooster to implement, As shown in:
I hope this article will help you design PHP programs based on the Yii framework.