How can I get a field value if the fieldname has whitespaces?
Or should I prevent whitespaces in fieldnames?
First “print” works.
Second “print” does not work.
$footerAddress = $site->find('contact')->addresses()->toStructure()->findBy('function', 'Architektur und Gestaltung');
print($footerAddress->firm());
print($footerAddress->field('street and number'));
The only allowed characters in field names are alphanumeric characters and underscores:
As already mentioned above, in PHP no other characters are allowed for functions (and field names are used as functions).
Did you add that content manually in the text files? Because your yaml linter should actually have complained if you tried to define such fields in a blueprint