Making opening and closing PHP tags fold?

Syntax highlighting, code folding, brace matching, code indenting, and function list

Making opening and closing PHP tags fold?

Postby Restless » Tue May 19, 2009 2:26 pm

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
Restless
Newbie
 
Posts: 4
Joined: Tue May 19, 2009 2:20 pm

Re: Making opening and closing PHP tags fold?

Postby Mofi » Wed May 20, 2009 4:57 am

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.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4066
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Making opening and closing PHP tags fold?

Postby Restless » Wed May 20, 2009 11:17 am

That makes perfect sense. Thank you very much!
Restless
Newbie
 
Posts: 4
Joined: Tue May 19, 2009 2:20 pm


Return to Syntax Highlighting