Example:
$view->with('test',array('one','two','three','four','five'));
var_dump($test)
array(5) { [0]=> string(3) "one" [1]=> string(3) "two" [2]=> string(5) "three" [3]=> string(4) "four" [4]=> string(4) "five" }
<? foreach ($test as $t) {
?>
<?= $t ?>
<? } ?>
only succeeds on a local environment:
one two three four five
Laravel Forge:
Undefined variable: t
Check this: http://php.net/manual/en/language.basic-syntax.phptags.php
Check if you have the short open tags option enabled, although it's recommended that you use the normal tags for those cases when you don't have access to php configuration: <?php ?>
I feel ashamed that I didn't notice it myself :)
Problem solved. It is indeed a bad habit to use the short tags.
Thanks
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community