Themes using Heredocs? (1 post)

  1. bucky
    Posted 10 years ago #

    I'm a longtime programmer, but new to WP...

    print <<<MyQuery
    Has anyone done a theme where they use heredocs
    in their templates? What I would like to do is try
    to separate the information gathering from
    presentation as much as possible.

    (I basically want to avoid a lot of the
    <?php stuff ?>, and expand vars instead --
    the constant context-switching between HTML and
    PHP calls gets a bit cumbersome to read)

    My basic approach with loops would be (pseudo-code...)

    start SomeLoop {
    // gather vars...

    print <<< WhatEverWeNeed
    <!-- some section of HTML -->
    spit out $thisVar and $thatVar
    <!-- that"s it for this chunk -->



    I'm hoping someone has done this. If not, I'll modify
    the default theme to this style and post it as an example.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.