Garey's Blog–FreeBSD/PHP/GoLang

二月 9th, 2010

[转]Netbeans Template配置

7,219 views, PHP, by garey.

一直用Netbeans写php,从来没配置过模板,模板配置好,可以省很多事,而且,显得很专业,今天到netbeans官方网站找了一些东西,配置好模板,方便开发。
新建php文件时:
<?php
/**
* Encoding     :   UTF-8
* Created on   :   2009-10-23 14:48:40 by smallchicken , microji@126.com
*/
?>
工具–模板–打开php里面的–“PHP 文件”,在编辑器中打开,
好,可以编辑模板文件。
当然,如果要写入时间和文件名之类的变量需要单独配置变量。
<?php
/**
* Encoding     :   ${encoding}
* Created on   :   ${date} ${time} by ${author} , ${email}
*/
?>
变量需要在  工具–模板–用户配置属性–User.properties   在编辑器中打开
email=microji@126.com
author=smallchicken
${date?date?string("yyyy-m-d")}
${time?time?string("H:i:s")}
写入变量就可以了。
日期和时间的格式和php相同,
变量名字可以自己定义。
官方的模板变量名列表:
http://wiki.netbeans.org/FaqTemplateVariables

原文:http://hi.baidu.com/smallchicken/blog/item/360b92c7f2e097d6d00060c8.html

Back Top

发表评论