This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 192048 - Template variables are not replaced when creating a PHP class
Summary: Template variables are not replaced when creating a PHP class
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-17 10:40 UTC by oliver.hv
Modified: 2011-06-08 13:52 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description oliver.hv 2010-11-17 10:40:08 UTC
With build 201011160001.
Given this template:
<?php
<#assign licenseFirst = "/* ">
<#assign licensePrefix = " * ">
<#assign licenseLast = " */">
<#include "../Licenses/license-${project.license}.txt">

/**
 * Description of ${name}
 *
 * @author ${user}
 */
class ${name} {
    //put your code here
}
?>

When I create a new PHP class I get this content:
<?php
/**
 * Created on ${date}
 *
 * Description of ${name}
 *
 * @author ${user}
 */
class ${name} {
    //put your code here
}
?>
Comment 1 oliver.hv 2010-11-17 15:17:06 UTC
This error doesn't always happen.
I click the right mouse button on a project's source folder.
There I select the 'New' option and a submenu appears. There I can see 2 'PHPClass...' options. One of them always fails to substitute template variables, the other one always work.
Comment 2 Tomas Mysik 2011-06-08 13:52:39 UTC
Can you try with a clean usedir [1]? This should work.

[1] http://wiki.netbeans.org/FaqAlternateUserdir