From 25a467fecd4ef264c27a36a15b48f0d6ac81e7a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Almeida?= Date: Sun, 4 Dec 2022 23:27:26 +0000 Subject: [PATCH 1/4] Docs for wrapper prefix and suffix Related with https://github.com/Laravel-Backpack/CRUD/pull/3502 --- 5.x/crud-columns.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/5.x/crud-columns.md b/5.x/crud-columns.md index c090deb1..6f87f70b 100644 --- a/5.x/crud-columns.md +++ b/5.x/crud-columns.md @@ -891,14 +891,17 @@ $this->crud->addColumn([ }, // 'target' => '_blank', // 'class' => 'some-class', + // 'prefix' => '(', + // 'suffix' => ')', ], ]); ``` If you specify ```wrapper``` to a column, the entries in that column will be wrapped in the element you specify. Note that: - 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; -- Anything you declare in the ```wrapper``` array (other than ```element```) will be used as HTML attributes for that element (ex: ```class```, ```style```, ```target``` etc); +- 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); - Each wrapper attribute, including the element itself, can be declared as a string OR as a callback; +- 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. Let's take another example, and wrap a boolean column into a green/red span: From 2d4207d39cb438b753fa994b32fc6e2ce5bd95cf Mon Sep 17 00:00:00 2001 From: Antonio Almeida Date: Sun, 7 Jan 2024 21:42:40 +0000 Subject: [PATCH 2/4] Moved docs about suffix and prefix to v6 --- 5.x/crud-columns.md | 10 ++++------ 6.x/crud-columns.md | 9 ++++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/5.x/crud-columns.md b/5.x/crud-columns.md index 640013a3..49e1ba6e 100644 --- a/5.x/crud-columns.md +++ b/5.x/crud-columns.md @@ -897,17 +897,15 @@ $this->crud->addColumn([ }, // 'target' => '_blank', // 'class' => 'some-class', - // 'prefix' => '(', - // 'suffix' => ')', ], ]); ``` -If you specify ```wrapper``` to a column, the entries in that column will be wrapped in the element you specify. Note that: +If you specify ```wrapper``` to a column, the entries in that column will be wrapped in the element you specify. Note that: - 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; -- 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); -- Each wrapper attribute, including the element itself, can be declared as a string OR as a callback; -- 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. +- Anything you declare in the ```wrapper``` array (other than ```element```) will be used as HTML attributes for that element (ex: ```class```, ```style```, ```target``` etc); +- Each wrapper attribute, including the element itself, can be declared as a `string` OR as a `callback`; + Let's take another example, and wrap a boolean column into a green/red span: diff --git a/6.x/crud-columns.md b/6.x/crud-columns.md index 22728cc4..09ca54fa 100644 --- a/6.x/crud-columns.md +++ b/6.x/crud-columns.md @@ -1556,14 +1556,17 @@ $this->crud->column([ }, // 'target' => '_blank', // 'class' => 'some-class', + // 'prefix' => '(', + // 'suffix' => ')', ], ]); ``` -If you specify ```wrapper``` to a column, the entries in that column will be wrapped in the element you specify. Note that: +If you specify ```wrapper``` to a column, the entries in that column will be wrapped in the element you specify. Note that: - 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; -- Anything you declare in the ```wrapper``` array (other than ```element```) will be used as HTML attributes for that element (ex: ```class```, ```style```, ```target``` etc); -- Each wrapper attribute, including the element itself, can be declared as a `string` OR as a `callback`; +- 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); +- Each wrapper attribute, including the element itself, can be declared as a string OR as a callback; +- 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. Let's take another example, and wrap a boolean column into a green/red span: From 5d16c317869792f953b8a710a5739b4d751edb2d Mon Sep 17 00:00:00 2001 From: Antonio Almeida Date: Sun, 7 Jan 2024 21:45:54 +0000 Subject: [PATCH 3/4] Fixes to keep consistencies --- 5.x/crud-columns.md | 4 ++-- 6.x/crud-columns.md | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/5.x/crud-columns.md b/5.x/crud-columns.md index 49e1ba6e..b565b9f0 100644 --- a/5.x/crud-columns.md +++ b/5.x/crud-columns.md @@ -901,10 +901,10 @@ $this->crud->addColumn([ ]); ``` -If you specify ```wrapper``` to a column, the entries in that column will be wrapped in the element you specify. Note that: +If you specify ```wrapper``` to a column, the entries in that column will be wrapped in the element you specify. Note that: - 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; - Anything you declare in the ```wrapper``` array (other than ```element```) will be used as HTML attributes for that element (ex: ```class```, ```style```, ```target``` etc); -- Each wrapper attribute, including the element itself, can be declared as a `string` OR as a `callback`; +- Each wrapper attribute, including the element itself, can be declared as a string OR as a callback; Let's take another example, and wrap a boolean column into a green/red span: diff --git a/6.x/crud-columns.md b/6.x/crud-columns.md index 09ca54fa..2c74624e 100644 --- a/6.x/crud-columns.md +++ b/6.x/crud-columns.md @@ -1562,11 +1562,11 @@ $this->crud->column([ ]); ``` -If you specify ```wrapper``` to a column, the entries in that column will be wrapped in the element you specify. Note that: +If you specify ```wrapper``` to a column, the entries in that column will be wrapped in the element you specify. Note that: - 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; -- 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); -- Each wrapper attribute, including the element itself, can be declared as a string OR as a callback; -- 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. +- 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); +- Each wrapper attribute, including the element itself, can be declared as a `string` OR as a `callback`; +- `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. Let's take another example, and wrap a boolean column into a green/red span: From aabc6cd36ed4d5b3ae2b48a84319713dd20cd15a Mon Sep 17 00:00:00 2001 From: Antonio Almeida Date: Sun, 7 Jan 2024 21:46:43 +0000 Subject: [PATCH 4/4] Fix formatting issue in crud-columns.md --- 5.x/crud-columns.md | 1 - 1 file changed, 1 deletion(-) diff --git a/5.x/crud-columns.md b/5.x/crud-columns.md index b565b9f0..0d72296b 100644 --- a/5.x/crud-columns.md +++ b/5.x/crud-columns.md @@ -906,7 +906,6 @@ If you specify ```wrapper``` to a column, the entries in that column will be wra - Anything you declare in the ```wrapper``` array (other than ```element```) will be used as HTML attributes for that element (ex: ```class```, ```style```, ```target``` etc); - Each wrapper attribute, including the element itself, can be declared as a string OR as a callback; - Let's take another example, and wrap a boolean column into a green/red span: ```php