File Templates » ${FILE_NAME}

Hi,

Trying to create a custom file template for Smarty .tpl files. I want to have the same file header as for standard PHP files, surronded with Smarty comments tags. Everything is working except that the predefined ${FILE_NAME} var doesn't fetches the filename of the file.

The setup is like this:

# Template
» Name: Smarty Template
» Extention: tpl

#parse("Smarty Template Header.tpl")

# Include
» Name: Smarty Template Header
» Extention: tpl

{**
* Project: ${PROJECT_NAME}
* File: ${FILE_NAME}
* Date:  ${DATE}
* Time:  ${TIME}
*}


When creating a new Smarty Template, all of the predefined vars are rendered exect the file name one. The following is the result of creating a new file:


{**
* Project: Test Project
* File: ${FILE_NAME}
* User:  Donald
* Date:  2013-06-07
* Time:  12:18
*}

Do anyone know a solution for this?

2 comments

Hi there,

The ${FILE_NAME} variable is available in bundled/predefined templates only.

You can use ${NAME} instead.

http://youtrack.jetbrains.com/issue/WI-7749

0

Please sign in to leave a comment.