Skip to content

Commit

Permalink
Update Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
khoirul anam committed Jan 23, 2017
1 parent 29b7211 commit 6e32619
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Property
example :
```php
<?php
use bootui\select2\Select2;
use moonland\select2\Select2;

echo $form->field($model, 'attribute1')->widget(Select2::className(), [
'items' => ['first' => 'First Option', 'second' => 'Second Option', 'third' => 'Third Option'],
Expand Down Expand Up @@ -92,12 +92,12 @@ example for use a `function` or `object` type :
<?php
echo Select2::widget([
//jquery inline function
'formatResult' => 'function format(state) { if (!state.id) return state.text;return "" + state.text;}',
'formatResult' => new JsExpression('function format(state) { if (!state.id) return state.text;return "" + state.text;}'),

//call existing function
'formatSelection' => 'js:formatSelection()',
'formatSelection' => new JsExpression('formatSelection()'),

//object
'data' => 'js:[{id:0,text:"enhancement"},{id:1,text:"bug"},{id:2,text:"duplicate"},{id:3,text:"invalid"},{id:4,text:"wontfix"}]',
'data' => new JsExpression('[{id:0,text:"enhancement"},{id:1,text:"bug"},{id:2,text:"duplicate"},{id:3,text:"invalid"},{id:4,text:"wontfix"}]'),
]);
```

0 comments on commit 6e32619

Please sign in to comment.