Updates composer.lock hash without updating any packages
composer update --lock
// 2 digit code | |
$language = \Drupal::languageManager()->getCurrentLanguage()->getId(); | |
// Name | |
$language = \Drupal::languageManager()->getCurrentLanguage()->getName(); |
if ($entity->hasTranslation('en')) { | |
$translated_entity = $entity->getTranslation('en'); | |
$translated_title = $translated_entity->getTitle(); | |
} |
Updates composer.lock hash without updating any packages
composer update --lock
{# Loop through items #} | |
{% for key, child in elements if key|first != '#' %} | |
<div class="{{ loop.first ? 'class-1' : 'class-2' }}">{{ child }}</div> | |
{% endfor %} |
This filter (alternatively, t
) will run the variable through the Drupal t()
function, which will return a translated string. This filter should be used for any interface strings manually placed in the template that will appear for users.
From How to add classes to links in Drupal 8
$url = Url::fromUri('http://drupal.org');
$link_options = array(
'attributes' => array(
'class' => array(
'my-first-class',
'my-second-class',
),
Config Tools is a package of modules that help to manage your Drupal 8 configuration files. This includes two modules currently.
https://www.drupal.org/project/config_tools