This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\example\Controller; | |
use Symfony\Component\HttpFoundation\Request; | |
use Drupal\Core\Controller\ControllerBase; | |
use Drupal\Core\Cache\CacheableJsonResponse; | |
use Drupal\Core\Cache\CacheableMetadata; | |
class ExampleController extends ControllerBase { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\example\Controller; | |
use Drupal\Core\Controller\ControllerBase; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpFoundation\JsonResponse; | |
class ExampleController extends ControllerBase { | |
public function getJson(Request $request) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div{{ attributes }}> | |
<p><span class="copyright-text">{% trans %} | |
Copyright © {{ year }} A Great Organization | |
{% endtrans %} | |
</span> | |
<span class="copyright-rights"> | |
{% trans %}All Rights Reserved{% endtrans %} | |
</span> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_theme(). | |
*/ | |
function custom_blocks_theme($existing, $type, $theme, $path) { | |
return [ | |
'custom_blocks_copyright' => [ | |
'variables' => [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\custom_blocks\Plugin\Block; | |
use Drupal\Core\Block\BlockBase; | |
/** | |
* Provides a 'CopyrightBlock' block. | |
* | |
* @Block( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function runTask($task_id, $site_name) { | |
$plugin = $this->pluginManagerService->createInstance($task_id); | |
$site = Site::load($site_name); | |
$status = $plugin->run($site); | |
if ($status == 'Success') { | |
$output = $plugin->getTaskOutput(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\sitemanager\Plugin\TaskPlugin; | |
use Drupal\sitemanager\Plugin\TaskPluginBase; | |
/** | |
* Class RunCron. | |
* | |
* @package Drupal\sitemanager\Plugin\TaskPlugin | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\sitemanager\Plugin; | |
use Drupal\Component\Plugin\PluginBase; | |
use Drupal\Core\Config\ConfigFactory; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; | |
use Drupal\Core\StringTranslation\StringTranslationTrait; | |
use Drupal\Core\StringTranslation\TranslationInterface; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\sitemanager\Plugin; | |
use Drupal\Component\Plugin\PluginInspectionInterface; | |
/** | |
* Defines an interface for Task plugin plugins. | |
*/ | |
interface TaskPluginInterface extends PluginInspectionInterface { |
NewerOlder