Zen Cart Logo
Forums / General Questions / Add a personal note in a php file

Add a personal note in a php file

Views: 642

Results 1 to 4 of 4
15 Feb 2013, 4:38 PM
#1
mcpisik avatar

mcpisik

Zen Follower

Join Date:
Jan 2007
Location:
Mount Maunganui, New Zealand
Posts:
417
Plugin Contributions:
0

Add a personal note in a php file

Hi,
I'd simply (and cleanly) like to add a personal note when I attempt to edit a php file.

Eg.
// "I added the below code when trying to install xsell module"
require($template->get_template_dir('tpl_modules_xsell_products.php',

(the // is just a wild shot. What should I use that so the comment doesn't affect the code?)

Thanks

15 Feb 2013, 4:41 PM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Add a personal note in a php file

Yes... this COMMENTS OUT php code - but be aware that in many files, the php is interspersed with html markup.

You can use the // comment tags, when the strings you are working with are enclosed in:

<?php code here... ?>

When it breaks to HTML, you use <!-- html here... -->

15 Feb 2013, 5:01 PM
#3
mcpisik avatar

mcpisik

Zen Follower

Join Date:
Jan 2007
Location:
Mount Maunganui, New Zealand
Posts:
417
Plugin Contributions:
0

Re: Add a personal note in a php file

Ah perfect. That's why it hadn't worked for me a while back.
Thanks for explaining.

16 Feb 2013, 3:30 PM
#4
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Add a personal note in a php file

Also note that // is a single line comment. If you want multiline comments, you can enclose them in /* and */

/*
This is a
multiline
comment
*/

is the same as

// This is a
// multiline
// comment