brotkrueml / schema

TYPO3 extension providing an API and view helpers for schema.org markup

Home Page:https://extensions.typo3.org/extension/schema

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Multiple types set dynamically

ste101 opened this issue · comments

Setting multiple types like this works:
TypeFactory::createType('Product', 'Service');

But if I want to set them dynamically through a variable I'm getting errors:
e.g:

$types = "'Product', 'Service'";
TypeFactory::createType($types);

I tried every writing, also arrays don't work.

Use argument unpacking:

$types = ['Product', 'Service'];
TypeFactory::createType(...$types);

See: https://www.php.net/manual/en/migration56.new-features.php#migration56.new-features.splat

Thank you for your help