diff --git a/examples/simple.json b/examples/simple.json index e0a7b9c..82aa9a4 100644 --- a/examples/simple.json +++ b/examples/simple.json @@ -6,6 +6,7 @@ "email": "Email", "created_at": "Дата создания", "description": "Описание 1", + "description2": "Описание 2", "status": "Статус" }, "actions": ["view"], diff --git a/examples/simple.php b/examples/simple.php index e4b5568..bccc66b 100644 --- a/examples/simple.php +++ b/examples/simple.php @@ -12,6 +12,9 @@ $table->columns([ "created_at" => [ "format" => "date:Y-m-d", ], + 'description2' => [ + "format" => "html:", + ], 'status' => function ($cell) { return getStatusLabel()[$cell]; }, diff --git a/src/FormatMapper.php b/src/FormatMapper.php index 7e0ca29..7ade4d2 100644 --- a/src/FormatMapper.php +++ b/src/FormatMapper.php @@ -3,6 +3,8 @@ namespace Itguild\Tables; use Itguild\Tables\formats\DateFormat; +use Itguild\Tables\formats\HtmlFormat; +use Itguild\Tables\formats\PhoneNumberFormat; use Itguild\Tables\formats\TextFormat; class FormatMapper @@ -13,6 +15,8 @@ class FormatMapper return [ 'text' => TextFormat::class, 'date' => DateFormat::class, + 'html' => HtmlFormat::class, + 'phoneNumber' => PhoneNumberFormat::class, ]; } diff --git a/src/formats/HtmlFormat.php b/src/formats/HtmlFormat.php new file mode 100644 index 0000000..fabef97 --- /dev/null +++ b/src/formats/HtmlFormat.php @@ -0,0 +1,14 @@ +