Hello,
I’ve got this weird issue with the e() function. I’m checking that the article has a cover before displaying it.
The code below returns an error when the cover is empty:
<?php e($article->cover()->isNotEmpty(), '<span><img src="' . $article->image($article->cover())->url() . '"/></span>' , '');?>
While this one doesn’t.
<?php e($article->cover()->isNotEmpty(), '<span><img src="' . thumb($article->file($article->cover()), array("width" => 1000))->url() . '"/></span>' , '' );?>
I’ve spent a lot of time trying to debug what was going on here… The only difference really is using thumb in the bottom one. It seems $article is throwing off the ($condition, $a, $b)
although there is no misplaced comma. Any thoughts?
Edit: the error is that I’m calling url() on an undefined object. Obviously it’s running the $a part of the code when it should be running $b…