Create New row using bootstrap widgets TbSelect2

695 Views Asked by At

Hello I am using bootstrap.widgets.TbSelect2 in Yii. You can see this link to check my form. https://www.diigo.com/item/p/qoaqepdzbsbbaqeqdzbcbrsdpa/bc91ebd999371bef68737b8320afed91

How to add the data in TbSelect2?

thank you.

1

There are 1 best solutions below

1
On

its so simple , just generate an array for this

    $this->widget('bootstrap.widgets.TbSelect2', array(
            'asDropDownList' => true,
            'name'           => 'status',
            'data'           => array( // свои значения для option
                'active'  => 'Active',
                'pending' => 'Pending',
                'invited' => 'Invited',
                'deleted' => 'Deleted'
            ),

        )

);