Templates for create class and new php files

General discussion on Zend Studio

Templates for create class and new php files

Postby rene6675 on Thu Jul 23, 2015 9:50 am

I'm testing ZendStudio

As usual with other IDEs, I try to insert their own content into the template.

Preferences -> PHP -> Code Style -> Code Templates -> Comments -> File / Types
Preferences -> PHP -> Code Style -> Code Templates -> Code -> New type / class body


My changes are not accepted. Even if I take the settings for my project.

The template variables ${file comment] and ${comment} type are not available.

Whether I create a class, interface, etc., are the new files without the desired content.

What can I do?

Thanks for the help.
rene6675
 
Posts: 5
Joined: Thu Jul 23, 2015 9:36 am

Re: Templates for create class and new php files

Postby rene6675 on Thu Jul 23, 2015 6:38 pm

It is a pity that no one knows how it works.

Sad, sad ....
rene6675
 
Posts: 5
Joined: Thu Jul 23, 2015 9:36 am

Re: Templates for create class and new php files

Postby rene6675 on Fri Jul 24, 2015 9:24 am

rene6675 wrote:Sad, sad ....


What shoud that?
I want to post the link to the number 318164 Back to the website of Eclipse !!!!!
Why can not I do not put HIM ??????


You are not authorized to post URL links, please remove or rename:
e_c_l_i_p_s_e_._o_r_g


For 5 years, it's a bug.
The XML file described can not be changed. It is packaged in a .jar file!

I do not know any PHP IDE, where you can not create your own templates.
I can not believe it, that does not resolve ZendStudio as leading and trendsetting PHP IDE these simple bug.

Why for $100.00 to spend?

Yours sincerely
rene6675
 
Posts: 5
Joined: Thu Jul 23, 2015 9:36 am

Re: Templates for create class and new php files

Postby mich6938 on Fri Jul 24, 2015 10:32 am

Hi,
Sorry for delayed response (it is holiday period so not everything is on time). I checked your problem with applying templates for new files and types and indeed something is not right and we need to investigate this. As a temporary workaround for applying comments to types I can suggest option from Source -> Generate Element Comment. It is less convenient, but it is what I can propose at the moment.

Regarding bug 318164 we are aware of it but unfortunately recently we had no resources to improve this.

I'm sorry for inconvenience and thank you for your feedback!
mich6938
Zend Product Manager
 
Posts: 352
Joined: Wed Jul 16, 2014 12:32 pm

Re: Templates for create class and new php files

Postby rene6675 on Fri Jul 24, 2015 3:07 pm

Hi,

many thanks for the answer.

In fact, with
mich6938 wrote:As a temporary workaround for applying comments to types I can suggest option from Source -> Generate Element Comment.

it works (shortcut SHIFT+ CTRL + J).

Only the comment for new files I do not get set.
Is there also a workaround?
rene6675
 
Posts: 5
Joined: Thu Jul 23, 2015 9:36 am

Re: Templates for create class and new php files

Postby mich6938 on Fri Jul 24, 2015 3:19 pm

I have no workaround for file comment at the moment, but if something will come to mind I will let you know.
mich6938
Zend Product Manager
 
Posts: 352
Joined: Wed Jul 16, 2014 12:32 pm

Re: Templates for create class and new php files

Postby rene6675 on Thu Dec 08, 2016 3:52 pm

I think it's a simple to change the java code.

The constans variables for template id:
Code: Select all
// new file from preferences PHP / Code Styles / Code Templates / Comments / File
content = org.eclipse.php.ui.CodeGeneration.getFileComment(ISourceModule sm, String lineDelimiter);

// PHPDoc for a class from preferences PHP / Code Styles / Code Templates / Code / Class body
content = org.eclipse.php.ui.CodeGeneration.getTypeBody(
    org.eclipse.php.ui.CodeGeneration.CLASS_BODY_TEMPLATE_ID, // Template ID for class
    IScriptProject sp,
    String typeName, // the class name
    String lineDelim
);

// PHPDoc for a interface from preferences PHP / Code Styles / Code Templates / Code / Interface body
content = org.eclipse.php.ui.CodeGeneration.getTypeBody(
    org.eclipse.php.ui.CodeGeneration.INTERFACE_BODY_TEMPLATE_ID, // Template ID for interface
    IScriptProject sp,
    String typeName, // the class name
    String lineDelim
);


I can hold for each inerhit method the PHPDoc. The short, the long description and for parameters.
This is so simple.
Why not added this?

AND the creations supported not PHP 7.1 or PHP 7.1

Interface:
Code: Select all
<?php
interface ITest
{
    public function get(string $name, int $index);
}


Class with creation tool:
Code: Select all
<?php
class Test implements \ITest
{
    /**
     * (non-PHPdoc)
     *
     * @see ITest::get()
     *
     */
    public function get($name, $index)
    {}
}


See PHP 7 support on the website ?????

Please change this. This is a couple of simple code lines.

Very nice here. I can not posted a link to our site :-(((
rene6675
 
Posts: 5
Joined: Thu Jul 23, 2015 9:36 am


Return to Zend Studio

Who is online

Users browsing this forum: No registered users and 5 guests