Making opening and closing PHP tags fold?

Making opening and closing PHP tags fold?

4
NewbieNewbie
4

    May 19, 2009#1

    Sometimes I work on files with multiple PHP blocks in them, so I'd like to be able to fold the <? and ?> tags. I tried to implement it by modifying the code folding strings lines in the appropriate place in my php.uew file, to no avail:

    Code: Select all

    /Open Fold Strings = "{" "<?"
    /Close Fold Strings = "}" "?>"
    
    It appears from my testing that the question mark is viewed as a special character and my various attempts to escape the character haven't been fruitful. What am I doing wrong?

    Thanks,
    Mike

    6,686585
    Grand MasterGrand Master
    6,686585

      May 20, 2009#2

      You can use in php.uew:

      /Open Fold Strings = "{" "?php"
      /Close Fold Strings = "}" "?>"

      That will work for php sections like

      <?php
      /*php block */
      ?>

      But if you use the short opening tag <? without php you have a problem because the < is interpreted by UltraEdit as HTML and therefore interpreted according to html.uew and the ? already as PHP interpreted according to php.uew. You could use

      /Open Fold Strings = "{" "?"
      /Close Fold Strings = "}" "?>"

      but I assume, you would not be happy with that open fold string.
      Best regards from an UC/UE/UES for Windows user from Austria

      4
      NewbieNewbie
      4

        May 20, 2009#3

        That makes perfect sense. Thank you very much!