Skip to main content
Add use statement
Source Link
Simon Vart
  • 188
  • 1
  • 6

Even simplier now with a one-liner on Drupal 8.9 (the decode function has been removed from the Yaml Symfony Dependency utility class) :

use Symfony\Component\Yaml\Yaml; 

$ymldata = Yaml::parseFile(DRUPAL_ROOT . '/core/modules/toolbar/toolbar.breakpoints.yml');

Even simplier now with a one-liner on Drupal 8.9 (the decode function has been removed from the Yaml utility class) :

$ymldata = Yaml::parseFile(DRUPAL_ROOT . '/core/modules/toolbar/toolbar.breakpoints.yml');

Even simplier now with a one-liner on Drupal 8.9 (the decode function has been removed from the Yaml Symfony Dependency utility class) :

use Symfony\Component\Yaml\Yaml; 

$ymldata = Yaml::parseFile(DRUPAL_ROOT . '/core/modules/toolbar/toolbar.breakpoints.yml');
Source Link
Simon Vart
  • 188
  • 1
  • 6

Even simplier now with a one-liner on Drupal 8.9 (the decode function has been removed from the Yaml utility class) :

$ymldata = Yaml::parseFile(DRUPAL_ROOT . '/core/modules/toolbar/toolbar.breakpoints.yml');