Jump to content

Search the Community

Showing results for tags 'alternative syntax'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 1 result

  1. This is a quick tip for my front-end developer peeps and other wanna-be-coders like me....I have been seeing this "strange" <?php endif; ?> code in some code here in the forums and in some template files. <?php if ($a == 5): ?> <p>A is equal to 5</p> <?php endif; ?> //In the above example, the HTML block "A is equal to 5" is nested within an if statement written in the alternative syntax. The HTML block would be displayed only if $a is equal to 5. //The alternative syntax applies to else and elseif as well. I have largely ignored it until I read about it more and wow! I wish I knew about it earlier. Anyway, you might want to read up about it. In a nutshell, it makes mixing PHP and HTML much more friendly in some cases. It helps avoid echoing out a lot of HTML but instead gives you flexibility to just type them out normally... A few resources to help you understand the alternative syntax. http://php.net/manual/en/control-structures.alternative-syntax.php http://www.brian2000.com/php/understanding-alternative-syntax-for-control-structures-in-php/ http://www.stoimen.com/blog/2010/03/10/php-if-else-endif-statements/ http://www.trans4mind.com/personal_development/phpTutorial/controlStructures.htm http://stackoverflow.com/questions/564130/difference-between-if-and-if-endif http://stackoverflow.com/questions/6023418/when-do-i-use-if-endif-versus-if http://www.trans4mind.com/personal_development/phpTutorial/controlStructures.htm
×
×
  • Create New...