Python Beginners

You’ll either use php short echo never or all the time

If you are using a something like twig or blade then you will never use them.

If you are using php as a raw templating engine, then you should use them.
Code:
<div>Welcome <?php echo $user->getFirstname() ?></div>

is so much noise compared to

Code:
<div>Welcome <?= $user->getFirstname() ?></div>

The IDE also makes it clear what is what

It also doesn’t require modifying “short_open_tag = On”

The only place you would ever use them are in “html” files
I never use them, ever.
Not in laravel not in pure php either.

Matter of preference I suppose.
 
I never use them, ever.
Not in laravel not in pure php either.

Matter of preference I suppose.

Personally, I prefer if <?= is used just because when I look at it I will instantly know it will be echoed, makes it quicker to read code, personal preference.
Laravel is MVC right? The only place you'll be using the short tag is in your View templates.
 
Personally, I prefer if <?= is used just because when I look at it I will instantly know it will be echoed, makes it quicker to read code, personal preference.
Laravel is MVC right? The only place you'll be using the short tag is in your View templates.
In my views I use <php //echo stuff ?>

Or
<?php
//loop stuff to echo
?>
 
Top
Sign up to the MyBroadband newsletter
X