File template with current path

Hi,

I have the following file template created but still need the path the new file is going to be saved.

#parse( "CPS-IT GmbH.php" )
#set( $Dollar = '$' )
#set( $Author = $Author )
#set( $Email = $Email )
#set( $Company = $Company )
#if ($NAME.indexOf('.') > 0)
#set( $File = $NAME.substring(0, $NAME.indexOf('.')) )
#else
#set ( $File = $NAME )
#set ( $NAME = "${NAME}.php" )
#end
<?php
/***************************************************************
*  Copyright notice
*
*  (c) ${YEAR} ${Author} <${Email}>, ${Company}
*  
*  All rights reserved
*
*  This script is part of the TYPO3 project. The TYPO3 project is
*  free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 3 of the License, or
*  (at your option) any later version.
*
*  The GNU General Public License can be found at
*  http://www.gnu.org/copyleft/gpl.html.
*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/

/**
*
* @author ${Author}
* @package ${Package}
* @subpackage ${Subpackage}
*/
class Tx_${Package}_ViewHelpers_${Subpackage}${File} extends Tx_Fluid_Core_ViewHelper_AbstractViewHelper {
    
    /**
     *
     */
    public function render() {
        
    }
}

if (defined('TYPO3_MODE') && ${Dollar}TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext//${NAME}']) {
    require_once (${Dollar}TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext//${NAME}']);
}
?>

If I use ${FILE_NAME} FILE_NAME is visible in the promt popping up to get variables. But I don't want to enter the whole path, I want it to get filled in automatically. Hope anyone can help me. I' using the latest version of EAP (PS-108.1421).

Cheers,
Nicole



Attachment(s):
2011-09-28_210155.jpg
2011-09-28_210142.jpg
1 comment
Comment actions Permalink

Hello Nicole,

The ${FILE_NAME} template variable only fills automatically when it used withing 'PHP FIle', 'PHP Class' or 'PHP Interface' templates.
I submitted an issue to PhpStorm\WebStorm issue tracker - http://youtrack.jetbrains.net/issue/WI-7749. Please vote.

Thank you for feedback!

0

Please sign in to leave a comment.