Symfony Twig Template Generator
Generate Twig templates instantly in Symfony projects with automatic folder creation and ready-to-use base layout.

Features
- Quickly create Twig templates from a path (e.g.
starship/show)
- Automatically generates the folder structure inside
templates/
- Inserts a ready-to-use Symfony Twig boilerplate
- Works from editor selection or command palette
- Optional automatic opening of the created file (configurable)
Usage
Method 1: Command Palette
- Open VS Code
- Press
Ctrl + Shift + P
- Run: Create Twig Template
- Enter your Twig path (e.g.
starship/show)
Method 2: Right-click (recommended)
- Select a Twig path in the editor (e.g.
starship/show)
- Right click
- Click Generate Twig Template
Output example
Input: starship/show
Generated file : templates/starship/show.html.twig
With content:
{% extends 'base.html.twig' %}
{% block body %}
{% endblock %}
Settings
This extension provides configurable options:
symfonyTwigTemplateGenerator.openDirectly
Controls whether the created file is automatically opened after generation.
| Value |
Behavior |
true (default) |
Automatically opens the created Twig file |
false |
Creates the file silently without opening it |
Why use it?
This extension removes repetitive manual work when creating Twig templates in Symfony projects by automating:
- Folder creation
- File creation
- Base layout setup
- Optional file opening control
Ideal for
- Symfony developers
- Twig-based projects
- Developers who want faster template scaffolding
Requirements
- Visual Studio Code ^1.85.0
- Symfony project using Twig
Extension Command
Generate Twig Template
Authors
| |