[Plugin SDK] How can I add a project type into PHP module??

Answered

Hello,

I'm a developing a plugin for an in-house framework, and I'm just getting started with plugin development.
I want to add a project type inside the "PHP" section, but I don't know how.

 

This screenshot explains what I'm looking for.

0
3 comments

Julián,

Check the Frameworks section in our docs.

0

Jakub Chrzanowski I've checked that article before posting this question, but the FrameworkTypeEx class only works for Java frameworks, not PHP ones.

0

Providing the projectTemplatesFactory extension point should do the job:

public final class MyTemplatesFactory extends ProjectTemplatesFactory {
@Override
public String @NotNull [] getGroups() {
return new String[]{"PHP"};
}

@Override
public Icon getGroupIcon(String group) {
return PhpIcons.PhpIcon;
}

@Override
public ProjectTemplate @NotNull [] createTemplates(@Nullable String group, WizardContext context) {
return new ProjectTemplate[]{new MyProjectGenerator()};
}
}

MyProjectGenerator should be an implementation of the WebProjectTemplate.

0

Please sign in to leave a comment.