add formats
This commit is contained in:
parent
7dbff619f5
commit
d0f136e484
@ -6,6 +6,7 @@
|
||||
"email": "Email",
|
||||
"created_at": "Дата создания",
|
||||
"description": "Описание 1",
|
||||
"description2": "Описание 2",
|
||||
"status": "Статус"
|
||||
},
|
||||
"actions": ["view"],
|
||||
|
@ -12,6 +12,9 @@ $table->columns([
|
||||
"created_at" => [
|
||||
"format" => "date:Y-m-d",
|
||||
],
|
||||
'description2' => [
|
||||
"format" => "html:",
|
||||
],
|
||||
'status' => function ($cell) {
|
||||
return getStatusLabel()[$cell];
|
||||
},
|
||||
|
@ -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,
|
||||
];
|
||||
}
|
||||
|
||||
|
14
src/formats/HtmlFormat.php
Normal file
14
src/formats/HtmlFormat.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Itguild\Tables\formats;
|
||||
|
||||
use Itguild\Tables\formats\BaseFormat;
|
||||
|
||||
class HtmlFormat extends BaseFormat
|
||||
{
|
||||
|
||||
static function fetch(?string $data, string $options = "")
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
14
src/formats/PhoneNumberFormat.php
Normal file
14
src/formats/PhoneNumberFormat.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Itguild\Tables\formats;
|
||||
|
||||
use Itguild\Tables\formats\BaseFormat;
|
||||
|
||||
class PhoneNumberFormat extends BaseFormat
|
||||
{
|
||||
|
||||
static function fetch(?string $data, string $options = "")
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user