Commit current progress.
This commit is contained in:
@@ -15,7 +15,7 @@ final class CharacterImport extends DrushCommands {
|
||||
public function importCharacters(): void {
|
||||
$http_client = \Drupal::httpClient();
|
||||
$character_endpoint = "https://dchadwick.ddev.site/api/character-list";
|
||||
$data = $http_client->get($character_endpoint)->getBody()->getContents();
|
||||
$data = $http_client->get($character_endpoint, ['verify'=>FALSE,])->getBody()->getContents();
|
||||
$json_data = json_decode($data, TRUE);
|
||||
// Create the queue.
|
||||
$character_import_queue = \Drupal::queue('character_import');
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Drupal\dc_core\Plugin\Block;
|
||||
|
||||
use Drupal\Core\Block\Attribute\Block;
|
||||
use Drupal\Core\Block\BlockBase;
|
||||
use Drupal\Core\StringTranslation\TranslatableMarkup;
|
||||
|
||||
#[Block(
|
||||
id: "copyright_block",
|
||||
admin_label: new TranslatableMarkup("Copyright Block"),
|
||||
category: new TranslatableMarkup("DC Core")
|
||||
)]
|
||||
final class CopyrightBlock extends BlockBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function build(): array {
|
||||
$year = date('Y');
|
||||
"<p>© Dan Chadwick {$year}</p>";
|
||||
$build = [
|
||||
'#markup' => "<p>© Dan Chadwick {$year}</p>",
|
||||
];
|
||||
|
||||
return $build;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user