11

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

/**
 * @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;

我怎样才能做到这一点?

4

2 回答 2

11

大写

${name?upper_case}

小写

${name?lower_case}

大写

${name?capitalize}

Netbeans 使用FreeMarker作为其模板语言。特定于您的请求的文档位于关于 strings 的页面上

于 2013-04-29T06:30:38.000 回答
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中查看更多信息

于 2012-07-24T20:29:10.250 回答