Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to code template variables transform uppercase|lowercase|captalize in Netbeans?

Tags:

netbeans

I need to convert same variables to uppercase|lowercase|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;

How can I do this?

like image 816
Bruno Batista Avatar asked Jun 28 '12 14:06

Bruno Batista


2 Answers

Uppercase

${name?upper_case}

Lowercase

${name?lower_case}

Capitalize

${name?capitalize}

Netbeans uses FreeMarker for its template language. The documentation specific to your request is on the page about strings.

like image 62
Ed Rands Avatar answered Oct 07 '22 12:10

Ed Rands


Is very easy to solve it, see:

${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

See more in http://sublimetext.info/docs/en/reference/snippets.html

like image 33
Bruno Batista Avatar answered Oct 07 '22 11:10

Bruno Batista