xandeadx

DeepSeek V4 Flash (free)

Jun 25th, 2026 (edited)
115
0
Never
4
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.12 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Drupal\current_date\Plugin\Block;
  4.  
  5. use Drupal\Core\Block\Attribute\Block;
  6. use Drupal\Core\Block\BlockBase;
  7. use Drupal\Core\Datetime\DateFormatterInterface;
  8. use Drupal\Core\Form\FormStateInterface;
  9. use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
  10. use Drupal\Core\StringTranslation\TranslatableMarkup;
  11. use Symfony\Component\DependencyInjection\ContainerInterface;
  12.  
  13. #[Block(
  14.  id: "current_date",
  15.   admin_label: new TranslatableMarkup("Current date"),
  16.   category: new TranslatableMarkup("Custom")
  17. )]
  18. class CurrentDateBlock extends BlockBase implements ContainerFactoryPluginInterface {
  19.  
  20.   public function __construct(
  21.     array $configuration,
  22.     $plugin_id,
  23.     $plugin_definition,
  24.     protected DateFormatterInterface $dateFormatter,
  25.   ) {
  26.     parent::__construct($configuration, $plugin_id, $plugin_definition);
  27.   }
  28.  
  29.   public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition): static {
  30.     return new static(
  31.       $configuration,
  32.       $plugin_id,
  33.       $plugin_definition,
  34.       $container->get('date.formatter'),
  35.     );
  36.   }
  37.  
  38.   public function defaultConfiguration(): array {
  39.     return [
  40.       'date_format' => 'Y-m-d',
  41.     ];
  42.   }
  43.  
  44.   public function blockForm($form, FormStateInterface $form_state): array {
  45.     $form['date_format'] = [
  46.       '#type' => 'textfield',
  47.       '#title' => $this->t('Date format'),
  48.       '#description' => $this->t('A PHP date format string as used by <a href=":url">date()</a>.', [
  49.         ':url' => 'https://www.php.net/manual/en/datetime.format.php',
  50.       ]),
  51.       '#default_value' => $this->configuration['date_format'],
  52.     ];
  53.     return $form;
  54.   }
  55.  
  56.   public function blockSubmit($form, FormStateInterface $form_state): void {
  57.     $this->configuration['date_format'] = $form_state->getValue('date_format');
  58.   }
  59.  
  60.   public function build(): array {
  61.     $date = $this->dateFormatter->format(time(), 'custom', $this->configuration['date_format']);
  62.     return [
  63.       '#markup' => '<div class="current-date">' . $this->t('Today is @date', ['@date' => $date]) . '</div>',
  64.     ];
  65.   }
  66.  
  67. }
  68.  
Advertisement
Comments
  • User was banned
  • User was banned
  • Wokexov
    25 days
    # CSS 0.44 KB | 0 0
    1. Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
  • User was banned
Add Comment
Please, Sign In to add comment