PHP Syntax Def

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Jeff

PHP Syntax Def

Post by Jeff »

Hello. I don't quite understand the syntax thing. I use php a lot and it would be nice if Textpad would make every word that starts with a $ be certain color. Is this possible, and how do I achieve it?
Thomas Hess

RE: PHP Syntax Def

Post by Thomas Hess »

Hi Jeff,

if you close all your open files in Textpad and then goto to the Configure, Preferences menu, you'll find something called "Document Classes"

Here you can define new document classes with specific syntax highlighting and much more.

When in the "Document lasses" click the "New" button. Then specify a name, i.e. "PHP". When done, click Apply.

If you expand "Document Classes", you'll now see a new classes with the name you just specified (PHP). Click this name and you'll see something called "Files in class PHP"

Click the "New" button below and type in the file extensions you use for your PHP document, i.e. *.php *.php3 *.inc

When done, click the expand button for "PHP" - you'll find 5 sub menues:

- Colors
- Font
- Printing
- Syntax
- Tabs

Select the "Syntax" and click the "Enable syntax highlighting". From the dropdown you can select from pre-defined Syntax Definition files. Select the one called "php.syn"

Click Apply and OK.

When you open your PHP documents now, you should get the syntax highligthed. If not, check that you specified the correct file extension when defining you class.

Hope this helps you out,
Thomas Hess

Neo Ideo, twh@neoideo.com
Post Reply