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 216235 - PHP Templates -> Add "PHTML File" template
Summary: PHP Templates -> Add "PHTML File" template
Status: REOPENED
Alias: None
Product: php
Classification: Unclassified
Component: Project (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-01 07:55 UTC by BullfrogBlues
Modified: 2016-03-07 21:49 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description BullfrogBlues 2012-08-01 07:55:11 UTC
Add .phtml file template. Can be the same as PHP File. 

Would be better if a template could have aliases of some kind oppose to duplication. 

Nonetheless, a .phtml would be very welcome.
Comment 1 Tomas Mysik 2012-08-01 08:00:44 UTC
Sorry, I don't understand exactly - PHTML file can be easily created:

- new PHP file
- name it "myfile.phtml"
- OK

What is the problem here? Thanks.
Comment 2 BullfrogBlues 2012-08-01 15:50:11 UTC
Sorry, it's not a defect it's an enhancement.

When creating a new php file you can 

- Right Click > New > PHP File... 
- Type the name of the file "bazbat" press Enter 

  Result: you get the file bazbat.php

I'd like to be able to do that with a ".phtml" file extension: 

- Right Click > New > PHTML File... 
- Type the name of the file "bazbat" press Enter 

  Result: you get the file bazbat.phtml

In other words I don't want to type the ".phtml" part.
Comment 3 BullfrogBlues 2012-08-01 16:26:05 UTC
PS: I just figured out how to do this manually. It ain't intuative or I'm just idiot. The latter is not doubt true to some extent.

- Create a php file with a ".phtml" extension "bazbat.phtml" via new PHP File...
- Enter the template code
- Right Click > "Save as Template..." > Select Category > Close

The file will be saved as "PHP File" in Templates, so you need to rename it.

Go to Tools > Templates > Rename the template.

For such a trivial thing it's mad confusing. But it can be done.
Comment 4 Tomas Mysik 2012-08-02 06:01:32 UTC
Thanks for the exact steps.

(In reply to comment #2)
> I'd like to be able to do that with a ".phtml" file extension: 

I am not sure whether it is doable or not since .php and .phtml are both simply PHP files (the IDE does not make any difference between .php and .phtml files).

Will check it, thanks for reporting.
Comment 5 seyfer 2013-11-05 02:13:14 UTC
Becouse you have Zend Framework integration in NetBeans, but don't have PHTML template, and ZF uses this file types as view.

It's irrational.
Comment 6 totumfacky 2016-03-07 21:49:06 UTC
Please add PHTML file type to "new" context menu in file tree. This file type is a part of Zend Framework and Netbeans supports ZF. Secondly it will speed up development for PHP developers using ZF.