1

I am running Timber framework on a Wordpress site and in my twig file I have the following code:

<div {{ fn('post_class', ['cell', 'small-12', 'medium-6', 'large-' ~ productTabW, 'xlarge-' ~ productW] ) }}>

On one server it outputs the correct:

<div class="cell small-12 medium-6 large-8 xlarge-6 post-66840 product type-product status-publish has-post-thumbnail product_cat-... ">

On another server I get this:

<divclass="cell small-12="" medium-6="" large-8="" xlarge-6="" post-66835="" product="" type-product="" status-publish="" has-post-thumbnail="" product_cat-....>

You will note the space is removed between the div and class and it looks like the array is expecting key value. The code is the same so I am wondering what php configuration would make Timber output this behaviour.

Ryan
  • 642
  • 3
  • 19
  • 2
    Does this answer your question? [PHP 7.4 trimming whitespace between string variables](https://stackoverflow.com/questions/61609531/php-7-4-trimming-whitespace-between-string-variables) – DarkBee Dec 29 '20 at 10:47

1 Answers1

1

This was a problem with an outdated Timber installation for PHP 7.4. Updating Timber through composer solved the issue.

Ryan
  • 642
  • 3
  • 19