Yaml::encode() doesn't work

Hello guys,

i want to create a widget and therefore should generate a yaml of an array. But it doesn’t work for me:

$data = array(‘username’ => ‘@example’);
$yaml = yaml::encode($data);

Whoops \ Exception \ ErrorException (E_ERROR)

Method Kirby\Panel\View::__toString() must not throw an exception, caught Error: Class ‘KirbyPluginInstaller\yaml’ not found

Whats wrong?

Thanks for your help!

Is there some more information in. the error message? Could. you post your complete. code? The Yamlclass is a class of the toolkit, but for some reason there is this KirbyPluginInstallernamespace that doesn’t make any sense. Looks like you are using a plugin that messes something up or are you extending that plugin? Then you have to use the yaml class.