Jump to content

[SOLVED] heredoc


Ninjakreborn

Recommended Posts

What are the standard opinions on the heredoc statement.  I never really liked the way they looked, but by investigating them further, you can throw $variables out in random places and it automatically detects the interpolation, also you don't have to escape double quotes.  In your opinion is heredoc, single quotes, or double quote's better.

Link to comment
Share on other sites

It took me a while to get to this point, but I like to break things down into small components that pop data in place using the <?=$var?> syntax.  I also allow for simple and extremely limited logic / program control within components, but the idea is 99% of the time that is handled elsewhere and the component merely slaps data into place.  As another general rule, I try and keep component files small; generally I can see the entire code contained in a component file without scrolling the text editor.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.