DateFormatDeleteForm.php in Drupal 9
File
core/modules/system/src/Form/DateFormatDeleteForm.php
View source
<?php
namespace Drupal\system\Form;
use Drupal\Core\Datetime\DateFormatterInterface;
use Drupal\Core\Entity\EntityDeleteForm;
use Symfony\Component\DependencyInjection\ContainerInterface;
class DateFormatDeleteForm extends EntityDeleteForm {
protected $dateFormatter;
public function __construct(DateFormatterInterface $date_formatter) {
$this->dateFormatter = $date_formatter;
}
public static function create(ContainerInterface $container) {
return new static($container
->get('date.formatter'));
}
public function getQuestion() {
return $this
->t('Are you sure you want to delete the format %name : %format?', [
'%name' => $this->entity
->label(),
'%format' => $this->dateFormatter
->format(REQUEST_TIME, $this->entity
->id()),
]);
}
}