如何编写模板变量在Netbeans中转换大写|小写| captalize?

时间:2012-06-28 14:13:36

标签: netbeans

我需要将相同的变量转换为大写|小写| captalize。

/**
 * @package     ${1 default="Hello"}
 * @subpackage  ${com}_${1 capitalize=false}
 * @copyright   Copyright (C) 2012 ${AtomTech}, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

// No direct access
defined('_JEXEC') or die;

我该怎么做?

2 个答案:

答案 0 :(得分:9)

大写

${name?upper_case}

小写

${name?lower_case}

大写

${name?capitalize}

Netbeans使用FreeMarker作为其模板语言。 特定于您的请求的文档是on the page about strings

答案 1 :(得分:3)

很容易解决,请参阅:

${1/(.+)/\L\1/g}

${var_name/regex/format_string/options}

var_name = 1

regex = (.+)

format_string = \L\1 (can use l|L|u|U)

options = g

http://sublimetext.info/docs/en/reference/snippets.html

中查看详情