default values for file template variables in phpStorm Joachim Thomas 创建于 2017年09月11日 14:30 Hi, is it possible to assign a default value to custom variables in file templates but have the input prompt for it in the form? thanks in advance, have a nice day Joachim Thomas
Hello,
What would be a use case of that? Could you describe it please?
a possible example:
#set ( $CLASSNAME = ${NAME.substring(4,5).toUpperCase()} + ${NAME.substring(5)} )
#set ( $MYPROJECT = ${PROJECT_NAME.toLowerCase()} )
============= HERE =====================
#set[default?] ($myBaseClass = 'BaseObject')
=====================================
<?php
/**
*
* @package baseObjects
* @version ${DS}Id: 1.0.0 ${DAY}.${MONTH}.${YEAR} ${MYPROJECT}$
* @author Joachim Thomas <jthomas@lightelements.com>
* @copyright ${YEAR} Joachim Thomas - lightelements software
*
* ${DAY}.${MONTH}.${YEAR} 1.0.0 ${MYPROJECT}
*
*/
class iobj${CLASSNAME} extends ${myBaseClass} {
Hi there,
See if this plugin ( http://plugins.jetbrains.com/plugin/7398-file-template-variables ) can be of any help here.