Skip to content

Commit 25a467f

Browse files
authored
Docs for wrapper prefix and suffix
Related with Laravel-Backpack/CRUD#3502
1 parent 2456c25 commit 25a467f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

5.x/crud-columns.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,14 +891,17 @@ $this->crud->addColumn([
891891
},
892892
// 'target' => '_blank',
893893
// 'class' => 'some-class',
894+
// 'prefix' => '(',
895+
// 'suffix' => ')',
894896
],
895897
]);
896898
```
897899

898900
If you specify ```wrapper``` to a column, the entries in that column will be wrapped in the element you specify. Note that:
899901
- To get an HTML anchor (a link), you can specify ```a``` for the element (but that's also the default); to get a paragraph you'd specify ```p``` for the element; to get an inline element you'd specify ```span``` for the element; etc;
900-
- Anything you declare in the ```wrapper``` array (other than ```element```) will be used as HTML attributes for that element (ex: ```class```, ```style```, ```target``` etc);
902+
- Anything you declare in the ```wrapper``` array (other than ```element```, `prefix` and `suffix`) will be used as HTML attributes for that element (ex: ```class```, ```style```, ```target``` etc);
901903
- Each wrapper attribute, including the element itself, can be declared as a string OR as a callback;
904+
- Prefix and Suffix will be placed inside the wrapper element, it is particularly useful when you have a list of entries (eg. `select_multiple`) you may have a general prefix and suffix on the column, and a specific one for each element.
902905

903906
Let's take another example, and wrap a boolean column into a green/red span:
904907

0 commit comments

Comments
 (0)