# Twig & Templates (Symfony) > Sintaxis Twig, variables, filtros, extends, include, blocks, forms rendering, assets - 20 preguntas de entrevista - Junior - [Preguntas de entrevista: Symfony](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista.md) ## 1. ¿Qué sintaxis se usa para mostrar una variable en una plantilla Twig? **Respuesta** La sintaxis {{ }} (dobles llaves) se usa para mostrar el contenido de una variable en Twig. Esta sintaxis realiza automáticamente el escape HTML para prevenir ataques XSS. Para las estructuras de control, usa {% %}, y para los comentarios {# #}. ## 2. ¿Cómo escribir un comentario en una plantilla Twig? **Respuesta** Los comentarios de Twig usan la sintaxis {# #}. Estos comentarios no se renderizan en el HTML final, a diferencia de los comentarios HTML estándar. Esto permite añadir notas para los desarrolladores sin exponer información a los usuarios. ## 3. ¿Cuál es el propósito del tag {% extends %} en Twig? **Respuesta** El tag extends permite la herencia de plantillas al definir una plantilla padre. La plantilla hija hereda toda la estructura del padre y puede sobrescribir los blocks definidos. Esto fomenta la reutilización y mantiene una estructura coherente en todo el sitio. ## 17 preguntas más disponibles - ¿Qué función de Twig genera la URL de un archivo asset (CSS, JS, imagen)? - ¿Cómo incluir otra plantilla Twig dentro de una plantilla? Regístrate gratis: https://sharpskill.dev/es/login ## Otros temas de entrevista Symfony - [PHP Moderno (8.1+)](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/php-modern-features.md): 20 preguntas, Junior - [Fundamentos de Symfony](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/symfony-basics.md): 25 preguntas, Junior - [Routing & Controllers](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/routing-controllers.md): 20 preguntas, Junior - [Fundamentos de Doctrine ORM](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/doctrine-orm-basics.md): 25 preguntas, Junior - [Formularios Symfony](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/forms.md): 22 preguntas, Junior - [Validación de datos](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/validation.md): 18 preguntas, Junior - [Dependency Injection & Services](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/dependency-injection.md): 24 preguntas, Mid-Level - [Security & Authentication](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/security-authentication.md): 26 preguntas, Mid-Level - [Doctrine avanzado](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/doctrine-advanced.md): 24 preguntas, Mid-Level - [API Platform](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/api-platform.md): 22 preguntas, Mid-Level - [Serializer Component](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/serializer.md): 20 preguntas, Mid-Level - [Events & Event Subscribers](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/events-subscribers.md): 20 preguntas, Mid-Level - [Console & Commands](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/console-commands.md): 18 preguntas, Mid-Level - [Messenger Component](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/messenger.md): 22 preguntas, Mid-Level - [HTTP Client](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/http-client.md): 18 preguntas, Mid-Level - [Cache y Rendimiento](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/cache.md): 20 preguntas, Mid-Level - [Workflow Component](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/workflow.md): 18 preguntas, Mid-Level - [Testing Symfony](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/testing.md): 22 preguntas, Mid-Level - [Mailer Component](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/mailer.md): 16 preguntas, Mid-Level - [Traducciones e i18n](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/translations.md): 16 preguntas, Mid-Level - [EasyAdmin Bundle](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/easyadmin.md): 18 preguntas, Mid-Level - [Arquitectura Symfony](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/architecture-patterns.md): 24 preguntas, Senior - [Rendimiento y optimización](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/performance-optimization.md): 22 preguntas, Senior - [Seguridad avanzada](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/security-advanced.md): 22 preguntas, Senior - [Bundles Personalizados](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/custom-bundles.md): 20 preguntas, Senior - [Microservices con Symfony](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/microservices.md): 22 preguntas, Senior - [Real-time & WebSockets](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/real-time.md): 18 preguntas, Senior - [Deployment & DevOps](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/deployment-devops.md): 20 preguntas, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/twig-templates