This file contains hidden or 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
/** | |
* Implements hook_library_info_build(). | |
* | |
* @return array | |
*/ | |
function mymodule_library_info_build() { | |
$libraries = []; | |
$api_key = \Drupal::config('mymodule.api_key'); |
This file contains hidden or 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\uwec_migration\Plugin\migrate\process; | |
use Drupal\migrate\MigrateExecutableInterface; | |
use Drupal\migrate\ProcessPluginBase; | |
use Drupal\migrate\Row; | |
/** | |
* This plugin allows your migration to spit the value to the command line. |
This file contains hidden or 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
/** | |
* Saves a file on your local file system you want to copy to Drupal default files directory. | |
* This assumes you have bootstrapped Drupal. | |
* Originally written to be invoked within a Behat context. | |
*/ | |
use Drupal\file\Entity\File; | |
$file = File::create([ | |
'uid' => 1 | |
]); |
This file contains hidden or 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_drush_command(). | |
*/ | |
function setlangcode_drush_command() { | |
$items = array(); | |
// The 'setlangcode' command. | |
$items['setlangcode'] = array( | |
'description' => "Sets the language code for certain types of entities.", |