Yaml::encode() doesn't work


#1

Hello guys,

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

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

Failure:
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!


#2

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.