CINXE.COM
Twig Templating for Friendly Frontend Devs Video Tutorial Screencast | SymfonyCasts
<!DOCTYPE html> <html lang="en" class="scroll-smooth"> <head prefix="og: http://ogp.me/ns#"> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content="Welcome to Twig! If you're a frontend developer and you're using Twig in your project, then this course is for you! We'll talk about how to use Twig from the ground-up, clearly pointing out its syntax and then graduating to some really neat and advanced tricks. Twig is awesome to work with, so don't..."> <meta property="og:title" content="Twig Templating for Friendly Frontend Devs Video Tutorial Screencast"> <meta property="og:description" content="Welcome to Twig! If you're a frontend developer and you're using Twig in your project, then this course is for you! We'll talk about how to use Twig from the ground-up, clearly pointing out its syntax and then graduating to some really neat and advanced tricks. Twig is awesome to work with, so don't..."> <meta property="og:url" content="https://symfonycasts.com/screencast/twig"> <meta property="og:image" content="https://symfonycasts.com/static/media/cache/course_video_poster_large/uploads/screencast/twig/twig-668.png"> <meta name="twitter:card" content="summary"> <title>Twig Templating for Friendly Frontend Devs Video Tutorial Screencast | SymfonyCasts</title> <link rel="stylesheet" href="https://symfonycasts.com/build/150.899c05e4.css" data-turbo-track="reload"><link rel="stylesheet" href="https://symfonycasts.com/build/tailwind.945ec199.css" data-turbo-track="reload"> <link rel="preconnect" href="https://kit.fontawesome.com"> <link rel="preconnect" href="https://api.fontshare.com"> <link rel="stylesheet" href="https://kit.fontawesome.com/f44096511e.css" crossorigin="anonymous"> <script async defer src="https://sa.symfonycasts.com/latest.js"></script> <script src="https://symfonycasts.com/build/runtime.a477f750.js" defer data-turbo-track="reload"></script><script src="https://symfonycasts.com/build/8764.79cb6dbe.js" defer data-turbo-track="reload"></script><script src="https://symfonycasts.com/build/7658.310a38b9.js" defer data-turbo-track="reload"></script><script src="https://symfonycasts.com/build/4987.fd46174f.js" defer data-turbo-track="reload"></script><script src="https://symfonycasts.com/build/4184.4446a197.js" defer data-turbo-track="reload"></script><script src="https://symfonycasts.com/build/2624.eedc0a93.js" defer data-turbo-track="reload"></script><script src="https://symfonycasts.com/build/969.cbfbbb6b.js" defer data-turbo-track="reload"></script><script src="https://symfonycasts.com/build/4430.b8f58b3a.js" defer data-turbo-track="reload"></script><script src="https://symfonycasts.com/build/4079.812ac5c4.js" defer data-turbo-track="reload"></script><script src="https://symfonycasts.com/build/tailwind.455d4657.js" defer data-turbo-track="reload"></script> </head> <body class="min-h-screen bg-white text-black-8 dark:text-white dark:bg-black-9" data-user-id="" > <header data-controller="mobile-menu" class="border-b border-black-2 dark:border-black-8 dark:bg-black-9"> <section class="max-w-screen-2xl mx-auto py-3 px-5 flex justify-between items-center"> <div class="flex grow"> <button data-action="mobile-menu#toggle:prevent" class="md:hidden cursor-pointer relative w-4 h-6 mt-2.5 mr-3"> <div class="bg-black-9 dark:bg-white w-4 h-0.5 rounded absolute top-4 -mt-0.5 transition-all duration-500 before:content-[''] before:bg-black-9 before:dark:bg-white before:w-4 before:h-0.5 before:rounded before:absolute before:transition-all before:duration-500 before:-translate-x-2 before:translate-y-2 after:content-[''] after:bg-black-9 after:dark:bg-white after:w-4 after:h-0.5 after:rounded after:absolute after:transition-all after:duration-500 after:-translate-x-2 after:-translate-y-2"></div> </button> <a href="/" class="text-3xl font-medium"> <div class="bg-[url('../images/symfonycasts-logo-dm.svg')] w-[52px] h-[45px] bg-cover bg-no-repeat min-[1099px]:bg-[url('../images/symfonycasts-logo.svg')] min-[1099px]:dark:bg-[url('../images/symfonycasts-logo-dm.svg')] min-[1099px]:w-[240px] min-[1099px]:bg-contain mr-5" alt="SymfonyCasts Logo"></div> </a> <span class="hidden md:flex md:grow items-center"> <form action="/screencast/twig/search" data-controller="rich-search" role="search" aria-expanded="false" class="group w-[228px] aria-expanded:w-full transition-all relative" > <div class="relative"> <div class="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"> <svg aria-hidden="true" class="w-5 h-5 text-black-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z" clip-rule="evenodd"></path></svg> </div> <input data-rich-search-target="input" autocomplete="off" data-action="keydown.meta+k@window->rich-search#openByKey keydown.ctrl+k@window->rich-search#openByKey focus->rich-search#open keydown->rich-search#hotkeys rich-search#syncInput" value="" name="q" type="text" class="w-full focus:ring-0 focus:ring-offset-0 focus:outline-none group-aria-expanded:border group-aria-expanded:rounded-b-none group-aria-expanded:border-b-0 group-aria-expanded:border-blue-6 bg-black-1 border dark:border-black-7 border-black-2 text-black-5 text-sm rounded-lg block pl-10 p-2 dark:bg-black-7 dark:placeholder-black-5 dark:text-white" placeholder="Search Tutorials" spellcheck="false" aria-label="search" > </div> <div data-rich-search-target="list" class="absolute w-full bg-black-1 dark:bg-black-7 rounded-b-lg z-30 group-aria-expanded:block hidden border border-t-0 border-blue-6" > <ul> <li data-rich-search-target="listItem" data-action="mouseover->rich-search#moveWithMouse click->rich-search#selectAndSubmit" class="group aria-selected:bg-blue-6 aria-selected:text-white cursor-pointer" aria-selected="true" data-search-action="/screencast/twig/search" > <div class="flex justify-between items-center p-3"> <i class="fa fa-search"></i> <span data-rich-search-target="textItem" class="pl-3 grow text-ellipsis overflow-hidden whitespace-nowrap"></span> <span class="text-black-9 dark:text-white rounded p-1 bg-black-2 dark:bg-black-8 font-normal text-sm min-w-[92px]">In this course</span> </div> </li> <li data-rich-search-target="listItem" data-action="mouseover->rich-search#moveWithMouse click->rich-search#selectAndSubmit" class="group aria-selected:bg-blue-6 aria-selected:text-white cursor-pointer rounded-b-lg" aria-selected="false" data-search-action="/search" > <div class="flex justify-between items-center p-3"> <i class="fa fa-search"></i> <span data-rich-search-target="textItem" class="grow pl-3 text-ellipsis overflow-hidden whitespace-nowrap"></span> <span class="text-black-9 dark:text-white rounded p-1 bg-black-2 dark:bg-black-8 font-normal text-sm min-w-[121px]">All SymfonyCasts</span> </div> </li> </ul> </div> </form> </span> </div> <div class="font-semibold"> <nav class="space-x-1.5 sm:space-x-2 min-[812px]:space-x-3 xl:space-x-5" aria-label="main"> <div class="inline-block md:hidden" data-controller="dropdown" data-dropdown-offset-value="40" data-dropdown-placement-value="bottom" data-dropdown-close-on-click-inside-value="false" data-dropdown-use-overlay-value="true" > <button data-action="dropdown#toggle:prevent" type="button" class="py-1 px-2.5"> <span class="sr-only">Open Search Menu</span> <i class="fas fa-search fa-fw"></i> </button> <div class="absolute z-50 hidden w-auto bg-white rounded-lg shadow dark:bg-black-8 py-5 px-7 after:absolute after:content-[''] after:top-0 after:-translate-y-6 after:left-0 after:right-0 after:mx-auto after:border-[12px] after:w-4 after:border-b-white after:dark:border-b-black-8 after:border-transparent" data-dropdown-target="block" > <form action="/search" data-controller="rich-search" role="search" aria-expanded="false" class="group w-[228px] aria-expanded:w-full transition-all relative" > <div class="relative"> <div class="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"> <svg aria-hidden="true" class="w-5 h-5 text-black-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z" clip-rule="evenodd"></path></svg> </div> <input data-rich-search-target="input" autocomplete="off" data-action="" value="" name="q" type="text" class="w-full focus:ring-0 focus:ring-offset-0 focus:outline-none group-aria-expanded:border group-aria-expanded:border-blue-6 bg-black-1 border dark:border-black-7 border-black-2 text-black-5 text-sm rounded-lg block pl-10 p-2 dark:bg-black-7 dark:placeholder-black-5 dark:text-white" placeholder="Search Tutorials" spellcheck="false" aria-label="search" > </div> </form> <h4 class="pt-4 pb-3 text-sm text-black-4 font-normal">Popular Search Topics</h4> <ul class="list-none font-semibold text-lg gap-3"> <li> <a href="/search?q=API%20Platform"> API Platform </a> </li> <li> <a href="/search?q=Doctrine"> Doctrine </a> </li> <li> <a href="/search?q=Turbo"> Turbo </a> </li> <li> <a href="/search?q=EasyAdmin"> EasyAdmin </a> </li> </ul> </div> </div> <div class="hidden md:inline-block" data-controller="dropdown" data-dropdown-offset-value="20" data-dropdown-placement-value="bottom" data-dropdown-close-on-click-inside-value="true" data-dropdown-use-overlay-value="false" > <a href="/courses" class="hover:text-blue-6">Tutorials</a> <button data-action="dropdown#toggle:prevent" type="button" class=""> <i class="fa-regular fa-ellipsis pl-1 hover:text-blue-6"></i> </button> <div class="z-50 absolute hidden w-auto bg-white divide-gray-100 rounded-lg shadow dark:bg-gray-700 dark:divide-gray-600 py-5 px-7" data-dropdown-target="block" > <a href="/courses" class="hover:text-blue-6"><span class="text-lg font-semibold underline">View all Courses</span> <span class="font-sm font-normal">(123)</span></a> <div class="grid grid-cols-2"> <div class="py-[6px] px-[6px] font-normal"> <a class="hover:text-blue-6" href="/tracks/symfony"><i class="fa-solid fa-circle-small pr-3 text-[10px]" style="color: #06E7FC"></i>Symfony 7</a> </div> <div class="py-[6px] px-[6px] font-normal"> <a class="hover:text-blue-6" href="/tracks/symfony6"><i class="fa-solid fa-circle-small pr-3 text-[10px]" style="color: #6B02F7"></i>Symfony 6</a> </div> <div class="py-[6px] px-[6px] font-normal"> <a class="hover:text-blue-6" href="/tracks/symfony5"><i class="fa-solid fa-circle-small pr-3 text-[10px]" style="color: #A6F124"></i>Symfony 5</a> </div> <div class="py-[6px] px-[6px] font-normal"> <a class="hover:text-blue-6" href="/tracks/rest"><i class="fa-solid fa-circle-small pr-3 text-[10px]" style="color: #7BE89B"></i>APIs</a> </div> <div class="py-[6px] px-[6px] font-normal"> <a class="hover:text-blue-6" href="/tracks/js-tools"><i class="fa-solid fa-circle-small pr-3 text-[10px]" style="color: #ED268F"></i>JavaScript Frameworks & Tools</a> </div> <div class="py-[6px] px-[6px] font-normal"> <a class="hover:text-blue-6" href="/tracks/javascript"><i class="fa-solid fa-circle-small pr-3 text-[10px]" style="color: #ED268F"></i>JavaScript Fundamentals</a> </div> <div class="py-[6px] px-[6px] font-normal"> <a class="hover:text-blue-6" href="/tracks/testing"><i class="fa-solid fa-circle-small pr-3 text-[10px]" style="color: #E7E517"></i>Testing</a> </div> <div class="py-[6px] px-[6px] font-normal"> <a class="hover:text-blue-6" href="/tracks/drupal"><i class="fa-solid fa-circle-small pr-3 text-[10px]" style="color: #AF04F6"></i>Drupal 8</a> </div> <div class="py-[6px] px-[6px] font-normal"> <a class="hover:text-blue-6" href="/tracks/oo"><i class="fa-solid fa-circle-small pr-3 text-[10px]" style="color: #3502ED"></i>OOP</a> </div> <div class="py-[6px] px-[6px] font-normal"> <a class="hover:text-blue-6" href="/tracks/php"><i class="fa-solid fa-circle-small pr-3 text-[10px]" style="color: #07DBDE"></i>PHP</a> </div> <div class="py-[6px] px-[6px] font-normal"> <a class="hover:text-blue-6" href="/tracks/extras"><i class="fa-solid fa-circle-small pr-3 text-[10px]" style="color: #E645CD"></i>Dev Tools</a> </div> </div> </div> </div> <a href="/gift-card/" class="hover:text-blue-6 hidden lg:inline">Gift Card</a> <a class="hover:text-blue-6 hidden lg:inline" href="/pricing">Pricing</a> <span class="hidden lg:inline border-r border-black-3 dark:border-black-6"></span> <div class="inline-block" data-controller="dropdown" data-dropdown-offset-value="40" data-dropdown-placement-value="bottom" data-dropdown-close-on-click-inside-value="true" data-dropdown-use-overlay-value="false" > <button data-action="dropdown#toggle:prevent" type="button" class="test-notifications-bell rounded-full py-1 px-2.5 hover:bg-black-1 hover:dark:bg-black-7 active:dark:bg-blue-8 active:dark:text-blue-5 active:bg-blue-1 active:text-blue-6"> <i class="fa fa-bell fa-fw relative"> <div class="bg-red-500 border-2 border-white dark:border-black-8 rounded-full h-[10px] w-[10px] absolute right-[-2px] top-[-2px]"></div> </i> </button> <div class="z-50 absolute h-[580px] overflow-y-scroll hidden md:2w-[530px] bg-white divide-y divide-gray-100 rounded-lg shadow dark:bg-gray-700 dark:divide-gray-600 py-5 px-7 after:absolute after:content-[''] after:top-0 after:-translate-y-6 after:right-5 after:border-[12px] after:w-4 after:border-b-white after:dark:border-b-gray-700 after:border-transparent" data-dropdown-target="block" > <div class="flex justify-between"> <span class="text-lg font-semibold pb-4">Notifications</span> </div> <div class="flex pt-7"> <turbo-frame id="user-notifications-page1" src="/updates" loading="lazy" target="_top"> Loading more entries <i class="fa fa-spinner fa-spin"></i> </turbo-frame> </div> </div> </div> <a href="#" class="nav-link py-1 px-2.5 hover:text-blue-6" data-controller="dark-mode-toggle" data-dark-mode-toggle-url-value="/api/set-dark-mode" data-dark-mode-toggle-class-name-value="dark" data-action="dark-mode-toggle#toggle:prevent" ><i class="fa fa-adjust fa-fw"></i></a> <span class="whitespace-nowrap"> <a class="btn-secondary-sm mr-2 whitespace-nowrap hidden md:inline-block" href="/login">Log In</a> <a class="btn-blue-sm whitespace-nowrap inline-block" href="/signup">Sign Up</a> </span> </nav> </div> </section> <section data-mobile-menu-target="menu" class="absolute top-68 z-40 border-b border-black-2 dark:border-black-7 bg-white dark:bg-black-8 w-full text-2xl flex-col origin-top animate-open-menu hidden"> <nav class="flex flex-col justify-between min-h-screen py-8" aria-label="mobile"> <div class="flex flex-col gap-2.5 p-0"> <div data-controller="toggle" data-toggle-button-toggle-classes-value="fa-angle-down fa-angle-up" data-toggle-hidden-classes-value="h-0 py-0" data-toggle-shown-classes-value="py-5" data-toggle-transition-height-value="true" > <div class="flex justify-between px-5"> <a href="/courses" class="hover:text-blue-6"> Tutorials </a> <button data-action="toggle#toggle:prevent"> <i class="fa-regular fa-angle-down pl-2 hover:text-blue-6"></i> </button> </div> <div class="bg-black-1 dark:bg-black-7 px-5 py-5 hidden overflow-hidden transition-all duration-500" data-toggle-target="content"> <span class="text-xs font-medium">Tracks (11)</span> <div class="py-[6px] px-[6px] text-base font-normal"> <a class="hover:text-blue-6" href="/tracks/symfony"><i class="fa-solid fa-circle-small pr-3 text-[10px]"></i>Symfony 7</a> </div> <div class="py-[6px] px-[6px] text-base font-normal"> <a class="hover:text-blue-6" href="/tracks/symfony6"><i class="fa-solid fa-circle-small pr-3 text-[10px]"></i>Symfony 6</a> </div> <div class="py-[6px] px-[6px] text-base font-normal"> <a class="hover:text-blue-6" href="/tracks/symfony5"><i class="fa-solid fa-circle-small pr-3 text-[10px]"></i>Symfony 5</a> </div> <div class="py-[6px] px-[6px] text-base font-normal"> <a class="hover:text-blue-6" href="/tracks/rest"><i class="fa-solid fa-circle-small pr-3 text-[10px]"></i>APIs</a> </div> <div class="py-[6px] px-[6px] text-base font-normal"> <a class="hover:text-blue-6" href="/tracks/js-tools"><i class="fa-solid fa-circle-small pr-3 text-[10px]"></i>JavaScript Frameworks & Tools</a> </div> <div class="py-[6px] px-[6px] text-base font-normal"> <a class="hover:text-blue-6" href="/tracks/javascript"><i class="fa-solid fa-circle-small pr-3 text-[10px]"></i>JavaScript Fundamentals</a> </div> <div class="py-[6px] px-[6px] text-base font-normal"> <a class="hover:text-blue-6" href="/tracks/testing"><i class="fa-solid fa-circle-small pr-3 text-[10px]"></i>Testing</a> </div> <div class="py-[6px] px-[6px] text-base font-normal"> <a class="hover:text-blue-6" href="/tracks/drupal"><i class="fa-solid fa-circle-small pr-3 text-[10px]"></i>Drupal 8</a> </div> <div class="py-[6px] px-[6px] text-base font-normal"> <a class="hover:text-blue-6" href="/tracks/oo"><i class="fa-solid fa-circle-small pr-3 text-[10px]"></i>OOP</a> </div> <div class="py-[6px] px-[6px] text-base font-normal"> <a class="hover:text-blue-6" href="/tracks/php"><i class="fa-solid fa-circle-small pr-3 text-[10px]"></i>PHP</a> </div> <div class="py-[6px] px-[6px] text-base font-normal"> <a class="hover:text-blue-6" href="/tracks/extras"><i class="fa-solid fa-circle-small pr-3 text-[10px]"></i>Dev Tools</a> </div> <a href="/courses" class="hover:text-blue-6"><span class="text-lg font-semibold underline">View all Courses</span> <span class="text-xs font-normal">(123)</span></a> </div> </div> <a href="/gift-card/" class="hover:text-blue-6 px-5"> Gift Card </a> <a class="hover:text-blue-6 px-5" href="/pricing">Pricing</a> </div> <div class="flex flex-col px-3"> <a class="btn-secondary-sm text-center" href="/login">Log In</a> <a class="btn-blue-sm text-center mt-2.5" href="/signup">Sign Up</a> </div> </nav> </section> </header> <main class="mx-auto"> <div id="course-wrapper" class="relative md:static md:grid transition-all duration-500 md:grid-cols-[375px_minmax(0,1fr)]" data-controller="toggle chapters-sidebar-mobile chapters-list" data-toggle-shown-classes-value="md:grid-cols-[375px_minmax(0,1fr)]" data-toggle-hidden-classes-value="md:grid-cols-[74px_minmax(0,1fr)] chapter-list-hidden" data-toggle-start-hidden-value="false" data-toggle-fully-hidden-class-value="" data-toggle-cookie-name-value="isChapterListHidden" data-toggle-target="content" data-chapters-list-full-rendered-url-value="/screencast/40/_chaptersList/progress?isChapterListHidden=0" > <div class="md:hidden z-30 fixed bottom-10 left-1/3" > <button class="btn-primary-sm hidden" data-action="chapters-sidebar-mobile#close" data-chapters-sidebar-mobile-target="closeButton" >Close Chapter List <i class="fa-solid fa-layer-group"></i></button> <button class="btn-primary-sm" data-action="chapters-sidebar-mobile#open" data-chapters-sidebar-mobile-target="openButton" >View Chapter List <i class="fa-solid fa-layer-group"></i></button> </div> <div data-simplebar id="chapter-list-40" data-turbo-permanent="true" data-chapters-sidebar-mobile-target="content" class="!absolute z-20 w-full md:!sticky hidden md:block -mb-10 top-0 md:h-screen overflow-y-scroll border-r border-black-3 dark:border-black-6 shadow-md md:shadow-none" style="scrollbar-width:none;" > <div class="bg-white dark:bg-black-9 flex-shrink-0" > <!-- start course chapter list --> <div class="pt-4"> <!-- Table of contents --> <turbo-frame id="chapters-list-40" target="_top" data-chapters-list-target="sidebar" > <div class="px-5"> <div class="flex pb-3 md:justify-between" data-toggle-target="addHidingClass" data-hiding-class="md:justify-end" data-showing-class="md:justify-between" > <p class="text-xl font-semibold block md:sidebar-collapsed:hidden">Chapters</p> <button class="js-chapter-arrow hidden md:block" > <i class="fa-solid fa-arrow-left-to-line transition-all duration-500 " data-toggle-target="addHidingClass" data-hiding-class="md:rotate-180" ></i> </button> </div> <div class="text-xs flex gap-2 md:sidebar-collapsed:hidden pb-5 whitespace-nowrap"> <span class="uppercase"><i class="fa-solid fa-layer-group pr-2"></i>9 Chapters</span> <span>|</span> <span><i class="fa fa-clock pr-2"></i> 41:18</span> <span>|</span> </div> </div> <ul class="border-t border-black-3 dark:border-black-6 pt-5 js-chapter-list"> <li class=" hover:bg-black-1 hover:dark:bg-black-8 px-4 md:px-0"> <div class="md:px-5 py-2.5" data-toggle-target="addHidingClass" data-hiding-class="md:px-2" data-showing-class="md:px-5" > <div class="relative"> <a href="/screencast/twig/basics" class=" block z-20 absolute w-full h-full js-chapter-link" ></a> <div> <div class="flex justify-between items-center"> <div class="border relative border-black-2 dark:border-black-5 rounded-2xl flex items-center justify-center w-14 h-[50px] flex-shrink-0"> <span class="text-sm z-10 font-medium">01</span> <div class="h-full absolute bg-black-2 dark:bg-black-7 rounded-l-2xl left-0" style="width: 0%;" ></div> </div> <div class="flex-grow pl-3 pr-2 md:sidebar-collapsed:hidden"> <div class="font-medium text-sm ">Twig: The Basics</div> </div> <div class="font-medium text-xs flex items-center md:sidebar-collapsed:hidden">6:07</div> </div> </div> </div> </div> </li> <li class=" hover:bg-black-1 hover:dark:bg-black-8 px-4 md:px-0"> <div class="md:px-5 py-2.5" data-toggle-target="addHidingClass" data-hiding-class="md:px-2" data-showing-class="md:px-5" > <div class="relative"> <a href="/screencast/twig/functions-filters" class=" block z-20 absolute w-full h-full js-chapter-link" ></a> <div> <div class="flex justify-between items-center"> <div class="border relative border-black-2 dark:border-black-5 rounded-2xl flex items-center justify-center w-14 h-[50px] flex-shrink-0"> <span class="text-sm z-10 font-medium">02</span> <div class="h-full absolute bg-black-2 dark:bg-black-7 rounded-l-2xl left-0" style="width: 0%;" ></div> </div> <div class="flex-grow pl-3 pr-2 md:sidebar-collapsed:hidden"> <div class="font-medium text-sm ">Functions, Filters and Debugging with dump</div> </div> <div class="font-medium text-xs flex items-center md:sidebar-collapsed:hidden">5:50</div> </div> </div> </div> </div> </li> <li class=" hover:bg-black-1 hover:dark:bg-black-8 px-4 md:px-0"> <div class="md:px-5 py-2.5" data-toggle-target="addHidingClass" data-hiding-class="md:px-2" data-showing-class="md:px-5" > <div class="relative"> <a href="/screencast/twig/objects-and-arrays" class=" block z-20 absolute w-full h-full js-chapter-link" ></a> <div> <div class="flex justify-between items-center"> <div class="border relative border-black-2 dark:border-black-5 rounded-2xl flex items-center justify-center w-14 h-[50px] flex-shrink-0"> <span class="text-sm z-10 font-medium">03</span> <div class="h-full absolute bg-black-2 dark:bg-black-7 rounded-l-2xl left-0" style="width: 0%;" ></div> </div> <div class="flex-grow pl-3 pr-2 md:sidebar-collapsed:hidden"> <div class="font-medium text-sm ">Using Objects and Array Keys</div> </div> <div class="font-medium text-xs flex items-center md:sidebar-collapsed:hidden">3:26</div> </div> </div> </div> </div> </li> <li class=" hover:bg-black-1 hover:dark:bg-black-8 px-4 md:px-0"> <div class="md:px-5 py-2.5" data-toggle-target="addHidingClass" data-hiding-class="md:px-2" data-showing-class="md:px-5" > <div class="relative"> <a href="/screencast/twig/layout-template-inheritance" class=" block z-20 absolute w-full h-full js-chapter-link" ></a> <div> <div class="flex justify-between items-center"> <div class="border relative border-black-2 dark:border-black-5 rounded-2xl flex items-center justify-center w-14 h-[50px] flex-shrink-0"> <span class="text-sm z-10 font-medium">04</span> <div class="h-full absolute bg-black-2 dark:bg-black-7 rounded-l-2xl left-0" style="width: 0%;" ></div> </div> <div class="flex-grow pl-3 pr-2 md:sidebar-collapsed:hidden"> <div class="font-medium text-sm ">Using a Layout: Template Inheritance</div> </div> <div class="font-medium text-xs flex items-center md:sidebar-collapsed:hidden">6:01</div> </div> </div> </div> </div> </li> <li class=" hover:bg-black-1 hover:dark:bg-black-8 px-4 md:px-0"> <div class="md:px-5 py-2.5" data-toggle-target="addHidingClass" data-hiding-class="md:px-2" data-showing-class="md:px-5" > <div class="relative"> <a href="/screencast/twig/including-other-templates" class=" block z-20 absolute w-full h-full js-chapter-link" ></a> <div> <div class="flex justify-between items-center"> <div class="border relative border-black-2 dark:border-black-5 rounded-2xl flex items-center justify-center w-14 h-[50px] flex-shrink-0"> <span class="text-sm z-10 font-medium">05</span> <div class="h-full absolute bg-black-2 dark:bg-black-7 rounded-l-2xl left-0" style="width: 0%;" ></div> </div> <div class="flex-grow pl-3 pr-2 md:sidebar-collapsed:hidden"> <div class="font-medium text-sm ">Including other Templates</div> </div> <div class="font-medium text-xs flex items-center md:sidebar-collapsed:hidden">2:12</div> </div> </div> </div> </div> </li> <li class=" hover:bg-black-1 hover:dark:bg-black-8 px-4 md:px-0"> <div class="md:px-5 py-2.5" data-toggle-target="addHidingClass" data-hiding-class="md:px-2" data-showing-class="md:px-5" > <div class="relative"> <a href="/screencast/twig/tests-if-statements" class=" block z-20 absolute w-full h-full js-chapter-link" ></a> <div> <div class="flex justify-between items-center"> <div class="border relative border-black-2 dark:border-black-5 rounded-2xl flex items-center justify-center w-14 h-[50px] flex-shrink-0"> <span class="text-sm z-10 font-medium">06</span> <div class="h-full absolute bg-black-2 dark:bg-black-7 rounded-l-2xl left-0" style="width: 0%;" ></div> </div> <div class="flex-grow pl-3 pr-2 md:sidebar-collapsed:hidden"> <div class="font-medium text-sm ">If Statements with "Tests"</div> </div> <div class="font-medium text-xs flex items-center md:sidebar-collapsed:hidden">2:30</div> </div> </div> </div> </div> </li> <li class=" hover:bg-black-1 hover:dark:bg-black-8 px-4 md:px-0"> <div class="md:px-5 py-2.5" data-toggle-target="addHidingClass" data-hiding-class="md:px-2" data-showing-class="md:px-5" > <div class="relative"> <a href="/screencast/twig/for-loop-inline-if" class=" block z-20 absolute w-full h-full js-chapter-link" ></a> <div> <div class="flex justify-between items-center"> <div class="border relative border-black-2 dark:border-black-5 rounded-2xl flex items-center justify-center w-14 h-[50px] flex-shrink-0"> <span class="text-sm z-10 font-medium">07</span> <div class="h-full absolute bg-black-2 dark:bg-black-7 rounded-l-2xl left-0" style="width: 0%;" ></div> </div> <div class="flex-grow pl-3 pr-2 md:sidebar-collapsed:hidden"> <div class="font-medium text-sm ">The for "loop" and inline "if" Syntax</div> </div> <div class="font-medium text-xs flex items-center md:sidebar-collapsed:hidden">3:58</div> </div> </div> </div> </div> </li> <li class=" hover:bg-black-1 hover:dark:bg-black-8 px-4 md:px-0"> <div class="md:px-5 py-2.5" data-toggle-target="addHidingClass" data-hiding-class="md:px-2" data-showing-class="md:px-5" > <div class="relative"> <a href="/screencast/twig/mistakes-macros" class=" block z-20 absolute w-full h-full js-chapter-link" ></a> <div> <div class="flex justify-between items-center"> <div class="border relative border-black-2 dark:border-black-5 rounded-2xl flex items-center justify-center w-14 h-[50px] flex-shrink-0"> <span class="text-sm z-10 font-medium">08</span> <div class="h-full absolute bg-black-2 dark:bg-black-7 rounded-l-2xl left-0" style="width: 0%;" ></div> </div> <div class="flex-grow pl-3 pr-2 md:sidebar-collapsed:hidden"> <div class="font-medium text-sm ">Mistakes and Macros</div> </div> <div class="font-medium text-xs flex items-center md:sidebar-collapsed:hidden">5:18</div> </div> </div> </div> </div> </li> <li class=" hover:bg-black-1 hover:dark:bg-black-8 px-4 md:px-0"> <div class="md:px-5 py-2.5" data-toggle-target="addHidingClass" data-hiding-class="md:px-2" data-showing-class="md:px-5" > <div class="relative"> <a href="/screencast/twig/extra-credit-tricks-escaping" class=" block z-20 absolute w-full h-full js-chapter-link" ></a> <div> <div class="flex justify-between items-center"> <div class="border relative border-black-2 dark:border-black-5 rounded-2xl flex items-center justify-center w-14 h-[50px] flex-shrink-0"> <span class="text-sm z-10 font-medium">09</span> <div class="h-full absolute bg-black-2 dark:bg-black-7 rounded-l-2xl left-0" style="width: 0%;" ></div> </div> <div class="flex-grow pl-3 pr-2 md:sidebar-collapsed:hidden"> <div class="font-medium text-sm ">Extra Credit Tricks and HTML Escaping</div> </div> <div class="font-medium text-xs flex items-center md:sidebar-collapsed:hidden">5:56</div> </div> </div> </div> </div> </li> </ul> </turbo-frame> </div> <!-- closes actual list of chapters --> </div> </div> <div class="flex-grow overflow-hidden course-content"> <div class="bg-contain bg-no-repeat overflow-hidden bg-[url('../images/hero-gradient.png')] dark:bg-[url('../images/hero-gradient-dark.png')] min-w-0"> <div class="max-w-screen-xl mx-auto px-4"> <div class="pt-6"> </div> <div class="flex justify-between text-sm pt-3 sm:pt-9 mb-3"> <div class="flex justify-start gap-2"> <div class="bg-[url('../images/sf-lm.svg')] dark:bg-[url('../images/sf-dm.svg')] w-6 h-4 bg-contain bg-no-repeat mt-[3px]" alt="SymfonyCasts Logo"></div> <span>></span> <a href="/tracks/drupal"> Drupal 8 </a> <span>></span> <p>Course Overview</p> </div> <div class="flex justify-end"> </div> </div> <section class="flex flex-col xl:flex-row xl:h-[294px] drop-shadow-md"> <div style="background-image: url(https://symfonycasts.com/static/media/cache/course_video_poster_large/uploads/screencast/twig/twig-668.png);" class="xl:order-2 relative rounded-t-3xl xl:rounded-r-3xl xl:rounded-tl-none bg-cover bg-center h-[210px] xl:h-full xl:w-[470px]"> <div class="absolute right-2 top-4"> <turbo-frame id="bookmark-controls-course-40"> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <button class="bg-white text-black-8 rounded-xl px-3 py-2" data-placement="bottom" > <i class="fal fa-bookmark"></i> </button> <span class="sr-only">Login to bookmark this course</span> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Login to bookmark this course</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </turbo-frame> </div> </div> <div class="xl:order-1 bg-white dark:bg-black-7 p-6 rounded-b-3xl xl:rounded-l-3xl xl:rounded-br-none flex-grow"> <h1 class="text-[32px] font-semibold leading-9">Twig Templating for Friendly Frontend Devs</h1> <p class="pt-2">Unlock Twig's full potential with our tutorial. Learn debugging techniques, whitespace control and looping tricks.</p> <div class="mt-14"> <a href="/pricing/twig" class="btn-primary-sm"> Buy Access </a> </div> </div> </section> <div class="flex flex-col xl:flex-row mt-10 border-b border-black-3 dark:border-black-6 pb-10"> <div class="xl:w-[205px] xl:shrink-0"> <ul class="text-xs font-medium uppercase space-y-4 border-b border-black-3 dark:border-black-6 pb-5"> <li><i class="pr-2 fa-solid fa-circle-user"></i>4265 students</li> <li><i class="pr-2 fa-solid fa-closed-captioning"></i>EN Captions</li> <li><i class="pr-2 fa-solid fa-language"></i>EN Script</li> <li><i class="pr-2 fa-solid fa-award"></i>Certificate of Completion</li> </ul> <h3 class="text-sm pt-5 mb-3">Your Guides</h3> <div class="space-y-2"> <div> <a href="https://github.com/weaverryan" target="_blank"> <img class="rounded-xl h-10 w-10 inline mr-2" src="https://avatars.githubusercontent.com/u/121003?v=4&s=200" alt="Ryan Weaver"> <span class="font-semibold whitespace-nowrap">Ryan Weaver</span> </a> </div> <div> <a href="https://github.com/Leannapelham" target="_blank"> <img class="rounded-xl h-10 w-10 inline mr-2" src="https://avatars.githubusercontent.com/u/777948?v=4&s=200" alt="Leanna Pelham"> <span class="font-semibold whitespace-nowrap">Leanna Pelham</span> </a> </div> </div> </div> <div class="xl:pl-10"> <h3 class="text-xl font-semibold mt-6 xl:mt-0">About this course</h3> <div class="bg-gradient-to-b from-blue-6/60 to-blue-6 rounded p-2 my-3 text-white"><i class="fa-solid fa-stars pr-2"></i>This tutorial uses Twig 1. There are newer versions of Twig, but they don't contain significant differences. So, Twig on!</div> <div data-controller="highlight-js"> <div class="inline" data-controller="course-deps"> <button class="my-2 btn-secondary-sm" data-action="course-deps#handleClick" >Twig 1</button> <div data-controller="modal" data-action="turbo:before-cache@window->modal#close modal:open->modal#open modal:close->modal#close" data-course-deps-target="dependenciesModal" > <dialog class="open:flex p-0 bg-white dark:bg-black-9 text-left shadow-xl transform rounded-lg shadow-xl inset-0 w-full md:w-fit md:max-w-[50%] md:min-w-[50%] animate-fade-in backdrop:bg-slate-600 backdrop:bg-opacity-80 backdrop:backdrop-blur-sm" data-modal-target="dialog" data-action="close->modal#close click->modal#clickOutside" > <div class="flex grow"> <div class="grow overflow-auto justify-center items-center"> <h3 class="py-3 text-2xl text-center font-medium text-black-9 dark:text-white border-b border-black-3 dark:border-black-6"> What PHP libraries does this tutorial use? </h3> <div class="prose dark:prose-invert"> <pre><code class="language-json">// composer.json { "require": [] }</code></pre> </div> </div> <button class="absolute right-4 top-4 dark:text-white flex items-center opacity-70 transition-opacity hover:opacity-100" data-action="modal#close" type="button" > <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 6l-12 12" /><path d="M6 6l12 12" /></svg> </button> </div> </dialog> </div> </div> </div> <div class="break-words text-lg prose dark:prose-invert overview"><p>Welcome to Twig! If you're a frontend developer and you're using Twig in your project, then this course is for you! We'll talk about how to use Twig from the ground-up, clearly pointing out its syntax and then graduating to some really neat and advanced tricks. Twig is awesome to work with, so don't just use Twig, master it!</p> <p>We'll learn:</p> <ul> <li>The Twig syntaxes: <code>{{ }}</code> and <code>{% %}</code></li> <li>Functions and filters</li> <li>Debugging with the <code>dump()</code> function</li> <li>Handling arrays and objects</li> <li>Template Inheritance (<code>extends</code> & <code>block</code>)</li> <li>Tests, looping tricks, and shortcut syntaxes</li> <li>Macros (Twig functions)</li> <li>Whitespace control, escaping and more!</li> </ul> <p>Ok, let's go!</p> </div> </div> </div> <h2 class="text-[22px] mt-[56px] mb-4 font-semibold mb-4"> Next courses in the <a class="underline" href="/tracks/drupal#dive-into-d8">Drupal 8: Dive into D8</a> section of the <a class="underline" href="/tracks/drupal"> Drupal 8 </a> Track! </h2> <div class="grid grid-cols-1 min-[900px]:grid-cols-2 xl:grid-cols-3 mb-14"> <div class="mb-5 pb-1 mr-3"> <a href="/screencast/drupal8-under-the-hood"> <div class=""> <img class="rounded-tr-[20px] rounded-tl-[20px]" src="https://symfonycasts.com/static/media/cache/course_tiles_outbound/uploads/screencast/drupal8-under-the-hood/drupal8-under-the-hood-138.png" alt="Drupal 8: Under the Hood"> </div> <div class="p-5 rounded-br-[20px] rounded-bl-[20px] border-r border-l border-b border-black-2 dark:border-black-7"> <h6 class="h-[56px] mb-3 text-lg font-semibold line-clamp-2">Drupal 8: Under the Hood</h6> <div class="text-[11px] flex uppercase gap-2"> <span><i class="fa-solid fa-layer-group pr-2"></i>18 Videos</span> <span>|</span> <span><i class="fa fa-clock pr-2"></i> 1:11:03</span> <span>|</span> <span><i class="fa-solid fa-flag-swallowtail pr-2"></i> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <span>0%</span> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> Your Progress <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <div class="progress-bar-container"> </div> </span> </div> </div> </a> </div> </div> <!-- Course Comments Section --> <a id="comments"></a> <div class="mt-6"> <div data-turbo="false" data-controller="user-nickname comment" data-comment-new-comment-form-url-value="/comment/course-40/form/new" data-comment-comments-total-value="29" data-comment-comments-translation-value="{"singular":"Comment","plural":"Comments"}" data-comment-comments-tf-id-value="comments-course-40" > <div class="flex justify-between pb-8"> <h3 class="text-xl font-semibold"> <span data-comment-target="commentsTotal">29</span> <span data-comment-target="commentsTotalTranslation">Comments</span> </h3> <div data-controller="dropdown" data-dropdown-placement-value="bottom-end"> <span class="text-xs border-r border-black-6 pr-3">Sort By</span> <button class="ml-3 text-sm" data-action="dropdown#toggle" data-comment-target="sortBtn"> <span class="sr-only">Open Sort By Menu</span> <span class="font-semibold">Most Useful</span> <i class="fas fa-caret-down"></i> </button> <ul data-dropdown-target="block" class="absolute text-sm z-10 hidden w-auto bg-white divide-gray-100 rounded-lg shadow dark:bg-gray-700 dark:divide-gray-600 py-2"> <li><a class="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white" href="#best" data-action="comment#sort" data-target-url="/comment/course-40?sort=best">Most Useful</a></li> <li><a class="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white" href="#newest" data-action="comment#sort" data-target-url="/comment/course-40?sort=newest">Newest</a></li> <li><a class="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white" href="#oldest" data-action="comment#sort" data-target-url="/comment/course-40?sort=oldest">Oldest</a></li> </ul> </div> </div> <div class="js-form-container comment-form-level-0"> <div class="w-full text-center"> <div class="break-normal font-semibold border border-black-2 dark:border-black-9 p-5 mb-9 bg-white dark:bg-black-8 rounded-xl" style="box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0.06), 0px 9px 20px 0px rgba(0, 0, 0, 0.06), 0px 37px 37px 0px rgba(0, 0, 0, 0.05), 0px 83px 50px 0px rgba(0, 0, 0, 0.03), 0px 147px 59px 0px rgba(0, 0, 0, 0.01), 0px 229px 64px 0px rgba(0, 0, 0, 0.00);"> <a href="/login" class="text-blue-6">Login</a> or <a href="/signup" class="text-blue-6">Register</a> to join the conversation </div> </div> </div> <div data-comment-target="comments" class="js-comments-container"> <turbo-frame src="/comment/course-40/list" id="comments-course-40"> <turbo-frame id="comments-course-40"> <div data-controller="comment-height"> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="27305" data-disqus-comment-id="964314144"> <a id="comment-27305"></a> <div class="comment-level-0 pr-4 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </span> <span class="space-x-1"> <strong>Peter Sergeev</strong> <a id="comment-27305" class="text-black-2" href="#comment-27305" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-27305" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-964314144"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>there is no product-price div now</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes">3</span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-27305" data-action="comment#reply" data-form-url="/comment/27305/form/reply?offset=1"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-27305" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-27305"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="27308" data-disqus-comment-id="964447702"> <a id="comment-27308"></a> <div class="comment-level-1 pr-4 py-2 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </span> <span class="space-x-1"> <strong>KnpUniversity</strong> <a href="#comment-27305"><small><i class="fas fa-share"></i> Peter Sergeev</small></a> <a id="comment-27308" class="text-black-2" href="#comment-27308" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-27308" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-964447702"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>Thanks for the typo catch! We've updated activity 1 :)</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-27308" data-action="comment#reply" data-form-url="/comment/27308/form/reply?offset=2"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-27308" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-27308"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="95" data-disqus-comment-id="1143458517"> <a id="comment-95"></a> <div class="comment-level-0 pr-4 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </span> <span class="space-x-1"> <strong>Dennis Gearon</strong> <a id="comment-95" class="text-black-2" href="#comment-95" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-95" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-1143458517"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>IT would be nice to see the before and after, textual output, and HTML rendering of same for all the filters</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes">1</span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-95" data-action="comment#reply" data-form-url="/comment/95/form/reply?offset=1"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-95" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-95"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="97" data-disqus-comment-id="1144146266"> <a id="comment-97"></a> <div class="comment-level-1 pr-4 py-2 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <a href="/u/weaverryan"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://avatars.githubusercontent.com/u/121003?v=4&s=100" alt="weaverryan avatar"> </a> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <a href="/u/weaverryan"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://avatars.githubusercontent.com/u/121003?v=4&s=100" alt="weaverryan avatar"> </a> </span> <span class="space-x-1"> <a href="/u/weaverryan"> <strong>weaverryan</strong> </a> <span class="px-1 font-semibold rounded text-xs text-white" style="background: linear-gradient(332.1deg, #0286C4 8.33%, #FFB800 162.53%);" title="SymfonyCasts Staff">SFCASTS</span> <a href="#comment-95"><small><i class="fas fa-share"></i> Dennis Gearon</small></a> <a id="comment-97" class="text-black-2" href="#comment-97" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-97" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-1144146266"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>Hi Dennis!</p><p>Can you explain a bit more what you'd like to see and why? Are you referring to the Twig filters - i.e. having a page to see the before and after affects of applying the filters? Or are you maybe talking about the activities? If you have a few minutes, I'd love to chat - you can email me at ryan@knplabs.com.</p><p>Thanks!</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-97" data-action="comment#reply" data-form-url="/comment/97/form/reply?offset=2"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-97" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-97"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="27306" data-disqus-comment-id="964317757"> <a id="comment-27306"></a> <div class="comment-level-0 pr-4 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </span> <span class="space-x-1"> <strong>Pascal Borreli</strong> <a id="comment-27306" class="text-black-2" href="#comment-27306" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-27306" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-964317757"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>.product-price div does not exist</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes">1</span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-27306" data-action="comment#reply" data-form-url="/comment/27306/form/reply?offset=1"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-27306" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-27306"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="27307" data-disqus-comment-id="964447433"> <a id="comment-27307"></a> <div class="comment-level-1 pr-4 py-2 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </span> <span class="space-x-1"> <strong>KnpUniversity</strong> <a href="#comment-27306"><small><i class="fas fa-share"></i> Pascal Borreli</small></a> <a id="comment-27307" class="text-black-2" href="#comment-27307" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-27307" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-964447433"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>Nice catch! We've got that updated :)</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes">1</span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-27307" data-action="comment#reply" data-form-url="/comment/27307/form/reply?offset=2"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-27307" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-27307"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="27309" data-disqus-comment-id="966644750"> <a id="comment-27309"></a> <div class="comment-level-0 pr-4 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </span> <span class="space-x-1"> <strong>enkuso</strong> <a id="comment-27309" class="text-black-2" href="#comment-27309" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-27309" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-966644750"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>Good cast for beginners,</p><p>Now I need more advanced twig tutorial. ;-)</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes">1</span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-27309" data-action="comment#reply" data-form-url="/comment/27309/form/reply?offset=1"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-27309" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-27309"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="1293" data-disqus-comment-id="2246345767"> <a id="comment-1293"></a> <div class="comment-level-0 pr-4 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </span> <span class="space-x-1"> <strong>Danny Avery</strong> <a id="comment-1293" class="text-black-2" href="#comment-1293" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-1293" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-2246345767"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>So, I'm rendering http://localhost:8888/twig/start/templates/homepage.php and nothing seems to be connected. (i.e. Bootstrap, etc) Also, when I go to place this "<h1>{{ pageTitle }}</h1>" in homepage.php, it renders the text as follows "{{ pageTitle }}". I am kind of lost as to where to begin with this project due to a lack of clarity. Can I please get some help? Thanks!</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-1293" data-action="comment#reply" data-form-url="/comment/1293/form/reply?offset=1"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-1293" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-1293"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="1296" data-disqus-comment-id="2248072045"> <a id="comment-1296"></a> <div class="comment-level-1 pr-4 py-2 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <a href="/u/weaverryan"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://avatars.githubusercontent.com/u/121003?v=4&s=100" alt="weaverryan avatar"> </a> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <a href="/u/weaverryan"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://avatars.githubusercontent.com/u/121003?v=4&s=100" alt="weaverryan avatar"> </a> </span> <span class="space-x-1"> <a href="/u/weaverryan"> <strong>weaverryan</strong> </a> <span class="px-1 font-semibold rounded text-xs text-white" style="background: linear-gradient(332.1deg, #0286C4 8.33%, #FFB800 162.53%);" title="SymfonyCasts Staff">SFCASTS</span> <a href="#comment-1293"><small><i class="fas fa-share"></i> Danny Avery</small></a> <a id="comment-1296" class="text-black-2" href="#comment-1296" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-1296" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-2248072045"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>Hey Danny!</p><p>I just hit you up by email, but in case anyone else has the same question, make sure you change the URL to execute the index.php file - so in your case, http://localhost:8888/twig/start/index.php. That file then executes templates/homepage.twig (so make sure you rename homepage.php to homepage.twig - we do that in the first chapter).</p><p>Also, to code along locally, you'll need to download Composer (<a href="https://disq.us/url?url=https%3A%2F%2Fgetcomposer.org%2Fdownload%2F%29%3AR24zGxc3N5ppxwPmqH9GqrcRYIs&cuid=1175718" rel="nofollow noopener" title="https://getcomposer.org/download/)">https://getcomposer.org/dow...</a> into the root of the project (i.e. the "start" directory) and then run "php composer.phar install".</p><p>Cheers!</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-1296" data-action="comment#reply" data-form-url="/comment/1296/form/reply?offset=2"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-1296" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-1296"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="1297" data-disqus-comment-id="2248086155"> <a id="comment-1297"></a> <div class="comment-level-2 pr-4 py-2 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <a href="/u/weaverryan"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://avatars.githubusercontent.com/u/121003?v=4&s=100" alt="weaverryan avatar"> </a> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <a href="/u/weaverryan"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://avatars.githubusercontent.com/u/121003?v=4&s=100" alt="weaverryan avatar"> </a> </span> <span class="space-x-1"> <a href="/u/weaverryan"> <strong>weaverryan</strong> </a> <span class="px-1 font-semibold rounded text-xs text-white" style="background: linear-gradient(332.1deg, #0286C4 8.33%, #FFB800 162.53%);" title="SymfonyCasts Staff">SFCASTS</span> <a href="#comment-1296"><small><i class="fas fa-share"></i> weaverryan</small></a> <a id="comment-1297" class="text-black-2" href="#comment-1297" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-1297" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-2248086155"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>Hey again!</p><p>I wanted to make things even a little easier, so I've just updated the code download. If you re-download, you won't need to worry about the "Composer" step above. The <a href="http://disq.us/url?url=http%3A%2F%2FREADME.md%3AjjlqoEmrcirVvvdn_9lxrQyVt5s&cuid=1175718" rel="nofollow noopener" title="README.md">README.md</a> in the code download also has details on how to get everything up and running. If you have any issues, let me know and we'll make sure we get them ironed out.</p><p>Cheers!</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-1297" data-action="comment#reply" data-form-url="/comment/1297/form/reply?offset=3"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-1297" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-1297"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="9001" data-disqus-comment-id="3772263200"> <a id="comment-9001"></a> <div class="comment-level-0 pr-4 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://secure.gravatar.com/avatar/beb6ef58ccd67855707eed752d6313b2?s=100&d=https%3A%2F%2Fsymfonycasts.com%2Fassets%2Fimages%2Favatars%2Fdefault-user.png" alt="Steve-D avatar"> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://secure.gravatar.com/avatar/beb6ef58ccd67855707eed752d6313b2?s=100&d=https%3A%2F%2Fsymfonycasts.com%2Fassets%2Fimages%2Favatars%2Fdefault-user.png" alt="Steve-D avatar"> </span> <span class="space-x-1"> <strong>Steve-D</strong> <a id="comment-9001" class="text-black-2" href="#comment-9001" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-9001" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-3772263200"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>Hi</p><p>I've completed the Twig course (more than once) but it still shows as 97% complete. Are you able to see why?</p><p>Thanks</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-9001" data-action="comment#reply" data-form-url="/comment/9001/form/reply?offset=1"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-9001" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-9001"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="9002" data-disqus-comment-id="3772385184"> <a id="comment-9002"></a> <div class="comment-level-1 pr-4 py-2 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <a href="/u/Victor"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://avatars.githubusercontent.com/u/3317635?v=4&s=100" alt="Victor avatar"> </a> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <a href="/u/Victor"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://avatars.githubusercontent.com/u/3317635?v=4&s=100" alt="Victor avatar"> </a> </span> <span class="space-x-1"> <a href="/u/Victor"> <strong>Victor</strong> </a> <span class="px-1 font-semibold rounded text-xs text-white" style="background: linear-gradient(332.1deg, #0286C4 8.33%, #FFB800 162.53%);" title="SymfonyCasts Staff">SFCASTS</span> <a href="#comment-9001"><small><i class="fas fa-share"></i> Steve-D</small></a> <a id="comment-9002" class="text-black-2" href="#comment-9002" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-9002" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-3772385184"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>Hey Steve,</p><p>Probably you left a challenge as not answered or not viewed chapter, look for checkboxes opposite chapter titles in the table of content. If you're still can't find a skipped thing, let us know your email registered on KnpU and we'll help you to discover missing thing :) You can send us your email directly to hello@knpuniversity.com or via our contact form <a href="https://disq.us/url?url=https%3A%2F%2Fknpuniversity.com%2Fcontact%3ALrs_UqZXOdjriOPwNigcPAv2LW0&cuid=1175718" rel="nofollow noopener" title="https://knpuniversity.com/contact">https://knpuniversity.com/c...</a> to avoid send it publicly in comments.</p><p>Cheers!</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-9002" data-action="comment#reply" data-form-url="/comment/9002/form/reply?offset=2"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-9002" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-9002"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="9004" data-disqus-comment-id="3772424131"> <a id="comment-9004"></a> <div class="comment-level-2 pr-4 py-2 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://secure.gravatar.com/avatar/beb6ef58ccd67855707eed752d6313b2?s=100&d=https%3A%2F%2Fsymfonycasts.com%2Fassets%2Fimages%2Favatars%2Fdefault-user.png" alt="Steve-D avatar"> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://secure.gravatar.com/avatar/beb6ef58ccd67855707eed752d6313b2?s=100&d=https%3A%2F%2Fsymfonycasts.com%2Fassets%2Fimages%2Favatars%2Fdefault-user.png" alt="Steve-D avatar"> </span> <span class="space-x-1"> <strong>Steve-D</strong> <a href="#comment-9002"><small><i class="fas fa-share"></i> Victor</small></a> <a id="comment-9004" class="text-black-2" href="#comment-9004" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-9004" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-3772424131"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>Have done that Victor, thank you</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-9004" data-action="comment#reply" data-form-url="/comment/9004/form/reply?offset=3"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-9004" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-9004"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="9007" data-disqus-comment-id="3772439269"> <a id="comment-9007"></a> <div class="comment-level-3 pr-4 py-2 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <a href="/u/Victor"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://avatars.githubusercontent.com/u/3317635?v=4&s=100" alt="Victor avatar"> </a> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <a href="/u/Victor"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://avatars.githubusercontent.com/u/3317635?v=4&s=100" alt="Victor avatar"> </a> </span> <span class="space-x-1"> <a href="/u/Victor"> <strong>Victor</strong> </a> <span class="px-1 font-semibold rounded text-xs text-white" style="background: linear-gradient(332.1deg, #0286C4 8.33%, #FFB800 162.53%);" title="SymfonyCasts Staff">SFCASTS</span> <a href="#comment-9004"><small><i class="fas fa-share"></i> Steve-D</small></a> <a id="comment-9007" class="text-black-2" href="#comment-9007" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-9007" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-3772439269"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>Great! Congrats with complete completing of the course ;)</p><p>Cheers!</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-9007" data-action="comment#reply" data-form-url="/comment/9007/form/reply?offset=3"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-9007" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-9007"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="318" data-disqus-comment-id="1355543023"> <a id="comment-318"></a> <div class="comment-level-0 pr-4 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </span> <span class="space-x-1"> <strong>MPH</strong> <a id="comment-318" class="text-black-2" href="#comment-318" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-318" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-1355543023"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>Is it possible in a twig template to add a redirect from an edit form? I am creating a news page where non-html users can fill out a form, submit and the twig template lays out the page.</p><p>That said, I want to give one option to copy/paste a URL in if they just want the headline to link to a URL instead of a page they are creating. Does this make sense...is this possible?</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-318" data-action="comment#reply" data-form-url="/comment/318/form/reply?offset=1"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-318" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-318"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="322" data-disqus-comment-id="1359803225"> <a id="comment-322"></a> <div class="comment-level-1 pr-4 py-2 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <a href="/u/weaverryan"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://avatars.githubusercontent.com/u/121003?v=4&s=100" alt="weaverryan avatar"> </a> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <a href="/u/weaverryan"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://avatars.githubusercontent.com/u/121003?v=4&s=100" alt="weaverryan avatar"> </a> </span> <span class="space-x-1"> <a href="/u/weaverryan"> <strong>weaverryan</strong> </a> <span class="px-1 font-semibold rounded text-xs text-white" style="background: linear-gradient(332.1deg, #0286C4 8.33%, #FFB800 162.53%);" title="SymfonyCasts Staff">SFCASTS</span> <a href="#comment-318"><small><i class="fas fa-share"></i> MPH</small></a> <a id="comment-322" class="text-black-2" href="#comment-322" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-322" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-1359803225"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>Hi there!</p><p>Actually, it's not *really* possible. The reason is that, strictly speaking, Twig just returns text. But to redirect, you need to set a 301/302 response with a Location header. That kind of logic is done in whatever layer is actually *calling* Twig.</p><p>The same seems true on your case - when I access a page (and you look up the page in the database, for example), you should determine before calling Twig that this is a page that is just a URL there and redirect in PHP.</p><p>Now, technically you *could* redirect in Twig just by writing some JavaScript and printing out the target URL via Twig inside a JavaScript string. That'd work just fine - it's a bit of a hacky way to do it, but I'm not here to judge ;).</p><p>Good luck!</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-322" data-action="comment#reply" data-form-url="/comment/322/form/reply?offset=2"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-322" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-322"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="63" data-disqus-comment-id="1077603353"> <a id="comment-63"></a> <div class="comment-level-0 pr-4 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </span> <span class="space-x-1"> <strong>John</strong> <a id="comment-63" class="text-black-2" href="#comment-63" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-63" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-1077603353"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>On <a href="http://disq.us/url?url=http%3A%2F%2Fknpuniversity.com%2Fscreencast%2Ftwig%2Ffunctions-filters%2Factivity%2F4%3An2RXDxIZr0QHq80RZwISmdqXklw&cuid=1175718" rel="nofollow noopener" title="http://knpuniversity.com/screencast/twig/functions-filters/activity/4">http://knpuniversity.com/sc...</a>, I've tried to add the line of code "{{ dump() }}" but it still comes up as wrong. Is there an answer sheet somewhere I can check? As I'm pretty sure my answer is correct.</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-63" data-action="comment#reply" data-form-url="/comment/63/form/reply?offset=1"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-63" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-63"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="64" data-disqus-comment-id="1077638592"> <a id="comment-64"></a> <div class="comment-level-1 pr-4 py-2 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <a href="/u/weaverryan"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://avatars.githubusercontent.com/u/121003?v=4&s=100" alt="weaverryan avatar"> </a> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <a href="/u/weaverryan"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://avatars.githubusercontent.com/u/121003?v=4&s=100" alt="weaverryan avatar"> </a> </span> <span class="space-x-1"> <a href="/u/weaverryan"> <strong>weaverryan</strong> </a> <span class="px-1 font-semibold rounded text-xs text-white" style="background: linear-gradient(332.1deg, #0286C4 8.33%, #FFB800 162.53%);" title="SymfonyCasts Staff">SFCASTS</span> <a href="#comment-63"><small><i class="fas fa-share"></i> John</small></a> <a id="comment-64" class="text-black-2" href="#comment-64" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-64" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-1077638592"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>Hi John!</p><p>It looks like your answer was right - the grading was too tight! I've fixed the issue (<a href="https://disq.us/url?url=https%3A%2F%2Fgithub.com%2Fknpuniversity%2Ftwig%2Fcommit%2F3843878e46b0680d5f68c81f172d624a535bfd86%29%3AIPgt-Qr_x5zujlTb1TC5avJFW4Y&cuid=1175718" rel="nofollow noopener" title="https://github.com/knpuniversity/twig/commit/3843878e46b0680d5f68c81f172d624a535bfd86)">https://github.com/knpunive...</a> and it should look good now. The rendered dump will look a little ugly (since we're showing the HTML source, not the rendered HTML) - we'll add a rendered HTML view soon that'll make it look better :).</p><p>Thanks for reporting the grading bug!</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-64" data-action="comment#reply" data-form-url="/comment/64/form/reply?offset=2"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-64" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-64"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="65" data-disqus-comment-id="1077705558"> <a id="comment-65"></a> <div class="comment-level-2 pr-4 py-2 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </span> <span class="space-x-1"> <strong>John</strong> <a href="#comment-64"><small><i class="fas fa-share"></i> weaverryan</small></a> <a id="comment-65" class="text-black-2" href="#comment-65" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-65" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-1077705558"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>Hi Ryan, cheers for the update. I think there is another small issue here: <a href="http://disq.us/url?url=http%3A%2F%2Fknpuniversity.com%2Fscreencast%2Ftwig%2Fobjects-and-arrays%2Factivity%2F6%3Amdb3pk6A52eXU27RvC7k_8X4GV0&cuid=1175718" rel="nofollow noopener" title="http://knpuniversity.com/screencast/twig/objects-and-arrays/activity/6">http://knpuniversity.com/sc...</a> I don't think the product object has the "postedAt" variable sent to it.</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-65" data-action="comment#reply" data-form-url="/comment/65/form/reply?offset=3"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-65" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-65"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="66" data-disqus-comment-id="1078120982"> <a id="comment-66"></a> <div class="comment-level-3 pr-4 py-2 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <a href="/u/weaverryan"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://avatars.githubusercontent.com/u/121003?v=4&s=100" alt="weaverryan avatar"> </a> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <a href="/u/weaverryan"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://avatars.githubusercontent.com/u/121003?v=4&s=100" alt="weaverryan avatar"> </a> </span> <span class="space-x-1"> <a href="/u/weaverryan"> <strong>weaverryan</strong> </a> <span class="px-1 font-semibold rounded text-xs text-white" style="background: linear-gradient(332.1deg, #0286C4 8.33%, #FFB800 162.53%);" title="SymfonyCasts Staff">SFCASTS</span> <a href="#comment-65"><small><i class="fas fa-share"></i> John</small></a> <a id="comment-66" class="text-black-2" href="#comment-66" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-66" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-1078120982"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>Thanks again John - the activity code wasn't updating correctly. It should be better now, but I'm going make some changes yet to be sure.</p><p>Again, thanks for letting us know :)</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes">1</span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-66" data-action="comment#reply" data-form-url="/comment/66/form/reply?offset=3"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-66" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-66"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="4714" data-disqus-comment-id="3112800515"> <a id="comment-4714"></a> <div class="comment-level-0 pr-4 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </span> <span class="space-x-1"> <strong>TorstenMaas</strong> <a id="comment-4714" class="text-black-2" href="#comment-4714" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-4714" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-3112800515"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>Hi Ryan,</p><p>the Twig documentation says we have to include files mit {% include ... %} instead of {{ include('_banner.twig') }}. The challenge can't be finished either with {{ ... }}. It seems that it changed or do i miss something?</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-4714" data-action="comment#reply" data-form-url="/comment/4714/form/reply?offset=1"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-4714" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-4714"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="4716" data-disqus-comment-id="3112999943"> <a id="comment-4716"></a> <div class="comment-level-1 pr-4 py-2 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <a href="/u/weaverryan"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://avatars.githubusercontent.com/u/121003?v=4&s=100" alt="weaverryan avatar"> </a> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <a href="/u/weaverryan"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://avatars.githubusercontent.com/u/121003?v=4&s=100" alt="weaverryan avatar"> </a> </span> <span class="space-x-1"> <a href="/u/weaverryan"> <strong>weaverryan</strong> </a> <span class="px-1 font-semibold rounded text-xs text-white" style="background: linear-gradient(332.1deg, #0286C4 8.33%, #FFB800 162.53%);" title="SymfonyCasts Staff">SFCASTS</span> <a href="#comment-4714"><small><i class="fas fa-share"></i> TorstenMaas</small></a> <a id="comment-4716" class="text-black-2" href="#comment-4716" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-4716" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-3112999943"></a> <span class="italic" title="1 year ago at February 21, 2023 17:40"><span class="text-xs">edited</span></span> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>Hey TorstenMaas!</p> <p>Great question actually - I've seen this confuse people in the past! Basically, both work, and are identical. BUT, <code>{% include ... %}</code> was the original syntax and <code>{{ include ... }}</code> was added later, and in general, is preferred. Why? Well, since <code>{{ ... }}</code> prints something, it makes sense just to make <code>include()</code> a function that you print... there's really no reason for there to be a special tag (i.e. {% ... %}) for it.</p> <p>So, you can use either, but {{ include }} is preferred! The challenge should allow you to have either - if you were having issues, it may have been related to a challenge bug in a deploy that we did last night (which is now fixed).</p> <p>Cheers!</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-4716" data-action="comment#reply" data-form-url="/comment/4716/form/reply?offset=2"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-4716" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-4716"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="27262" data-disqus-comment-id="904127483"> <a id="comment-27262"></a> <div class="comment-level-0 pr-4 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </span> <span class="space-x-1"> <strong>Pieter Lelaona</strong> <a id="comment-27262" class="text-black-2" href="#comment-27262" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-27262" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-904127483"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>great !!! owesome !!! thanks.. :)</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-27262" data-action="comment#reply" data-form-url="/comment/27262/form/reply?offset=1"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-27262" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-27262"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="383" data-disqus-comment-id="1409484273"> <a id="comment-383"></a> <div class="comment-level-0 pr-4 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </span> <span class="space-x-1"> <strong>SHirshak</strong> <a id="comment-383" class="text-black-2" href="#comment-383" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-383" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-1409484273"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>really knpuniversity is great > thanks for the best tutorial...you gies don't know you have cleared all my confusions</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-383" data-action="comment#reply" data-form-url="/comment/383/form/reply?offset=1"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-383" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-383"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="446" data-disqus-comment-id="1451966268"> <a id="comment-446"></a> <div class="comment-level-0 pr-4 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </span> <span class="space-x-1"> <strong>capSix</strong> <a id="comment-446" class="text-black-2" href="#comment-446" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-446" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-1451966268"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>Hello. I have a silly question. How can I render my twig templates from an array.<br>Example, I have rendered the parent & child templates, however if I want to link them form the nav menu, nothing seems to work. I have used the example above as I am using Twig as standalone to my project, not with Symphony.</p><p>Can anyone help please. Much appreciated. Thank you !<br>Great job with all the videos, btw.</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-446" data-action="comment#reply" data-form-url="/comment/446/form/reply?offset=1"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-446" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-446"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="453" data-disqus-comment-id="1457865410"> <a id="comment-453"></a> <div class="comment-level-1 pr-4 py-2 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <a href="/u/weaverryan"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://avatars.githubusercontent.com/u/121003?v=4&s=100" alt="weaverryan avatar"> </a> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <a href="/u/weaverryan"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://avatars.githubusercontent.com/u/121003?v=4&s=100" alt="weaverryan avatar"> </a> </span> <span class="space-x-1"> <a href="/u/weaverryan"> <strong>weaverryan</strong> </a> <span class="px-1 font-semibold rounded text-xs text-white" style="background: linear-gradient(332.1deg, #0286C4 8.33%, #FFB800 162.53%);" title="SymfonyCasts Staff">SFCASTS</span> <a href="#comment-446"><small><i class="fas fa-share"></i> capSix</small></a> <a id="comment-453" class="text-black-2" href="#comment-453" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-453" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-1457865410"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>Hey there!</p><p>Thanks about the videos :).</p><p>So when you're using Twig standalone, it's not concerned with how you create links from one page to another. It really can't be - because it doesn't necessarily know that "about.twig" lives at /about and "homepage.twig" lives at "/". So, it's your responsibility to make the links between the pages.</p><p>But, I have a feeling that I'm not actually answering your question :). So let me know if I'm not and pass more information - like what your link code looks like and any errors, etc.</p><p>Cheers!</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-453" data-action="comment#reply" data-form-url="/comment/453/form/reply?offset=2"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-453" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-453"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="459" data-disqus-comment-id="1461255014"> <a id="comment-459"></a> <div class="comment-level-2 pr-4 py-2 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://symfonycasts.com/assets/images/avatars/default-user.png" alt="Default user avatar"> </span> <span class="space-x-1"> <strong>capSix</strong> <a href="#comment-453"><small><i class="fas fa-share"></i> weaverryan</small></a> <a id="comment-459" class="text-black-2" href="#comment-459" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-459" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-1461255014"></a> <span class="italic" title="2 years ago at September 7, 2022 07:53"><span class="text-xs">edited</span></span> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>Hello. Thank you for you reply. Correct, my issue is to render the pages. I have created arrays in my app.php file, example:</p> <pre><code class="language-php"> echo $twig->render('index.html.twig', array( 'item'=>array( 'home'=>array( 'title' =>'Home', 'url '=>'/', ), 'about'=>array( 'title' =>'About us', 'url' =>'about-us.html', ), ) )); </code></pre> <p>Main<br /> thing is i'm not sure how to link then from the html, i have tried <br />adding on the {{ item.about.url }} block, but doesnt seem to pick it up.</p> <p>I'm sure it's something pretty basic and simple, but have been struggling to make it work.</p> <p>As a ref I've followed your video Twig-The Basics...</p> <p>Do you think you could help me out with this?</p> <p>Thank you very much, really appreciated.</p> <p>Thank you!</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-459" data-action="comment#reply" data-form-url="/comment/459/form/reply?offset=3"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-459" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-459"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="460" data-disqus-comment-id="1461387863"> <a id="comment-460"></a> <div class="comment-level-3 pr-4 py-2 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <a href="/u/weaverryan"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://avatars.githubusercontent.com/u/121003?v=4&s=100" alt="weaverryan avatar"> </a> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <a href="/u/weaverryan"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://avatars.githubusercontent.com/u/121003?v=4&s=100" alt="weaverryan avatar"> </a> </span> <span class="space-x-1"> <a href="/u/weaverryan"> <strong>weaverryan</strong> </a> <span class="px-1 font-semibold rounded text-xs text-white" style="background: linear-gradient(332.1deg, #0286C4 8.33%, #FFB800 162.53%);" title="SymfonyCasts Staff">SFCASTS</span> <a href="#comment-459"><small><i class="fas fa-share"></i> capSix</small></a> <a id="comment-460" class="text-black-2" href="#comment-460" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-460" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-1461387863"></a> <span class="italic" title="2 years ago at September 7, 2022 07:55"><span class="text-xs">edited</span></span> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>Hi there!</p> <p>Actually, you're doing everything perfectly. I've copied your code into a gist so it's more readable (code isn't so great in the comments): <a href="https://gist.github.com/weaverryan/26c8166d16454b4c0829">https://gist.github.com/weaverryan/26c8166d16454b4c0829</a>. And basically, what you're doing is perfect, so it <em>should</em> be working just fine.</p> <p>Are you getting an error or just no value is printed? Also, try simply putting:</p> <pre><code class="language-twig">{{ dump() }} </code></pre> <p>temporarily. This will dump all variables you have access to. This will help you make sure that you have access to the variables that you think you have access to.</p> <p>Let me know what you find out!</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-460" data-action="comment#reply" data-form-url="/comment/460/form/reply?offset=3"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-460" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-460"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> <div class="js-comment-container transition-all rounded-md p-2" data-comment-id="478" data-disqus-comment-id="1490849669"> <a id="comment-478"></a> <div class="comment-level-0 pr-4 flex justify-start"> <div class="hidden lg:block lg:min-w-fit"> <a href="/u/somecallmetim"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://secure.gravatar.com/avatar/995e99c3a2bc96715fabb5ccc5829283?s=100&d=https%3A%2F%2Fsymfonycasts.com%2Fassets%2Fimages%2Favatars%2Fdefault-user.png" alt="somecallmetim avatar"> </a> </div> <div class="ml-3 grow min-w-0"> <div class="flex justify-between"> <div> <span class="lg:hidden pr-2 lg:pr-0"> <a href="/u/somecallmetim"> <img class="inline lg:block mb-2 w-[25px] h-[25px] lg:w-[42px] lg:h-[42px] rounded" src="https://secure.gravatar.com/avatar/995e99c3a2bc96715fabb5ccc5829283?s=100&d=https%3A%2F%2Fsymfonycasts.com%2Fassets%2Fimages%2Favatars%2Fdefault-user.png" alt="somecallmetim avatar"> </a> </span> <span class="space-x-1"> <a href="/u/somecallmetim"> <strong>somecallmetim</strong> </a> <a id="comment-478" class="text-black-2" href="#comment-478" title="June 16, 2018 00:06" data-controller="comment#setHighlighted:prevent" data-comment-id-param="comment-478" ><span class="text-xs text-black-4 capitalize">6 years ago</span></a> <a id="comment-1490849669"></a> </span> </div> </div> <div data-controller="highlight-js" class="js-comment-text"> <div class="comment-code prose dark:prose-invert leading-6"> <p>I really love the videos you guys put out. They're really well organized and I genuinely learn great things easily from your tutorials. :)</p> </div> </div> <div class="space-x-3 mt-1 mb-3"> <span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <i class="fal fa-thumbs-up"></i> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content"> Please, log in to vote for this comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> <span class="js-comment-votes"></span> </span> <span>|</span> <a class="js-comment-reply" href="#reply-478" data-action="comment#reply" data-form-url="/comment/478/form/reply?offset=1"><i class="fal fa-comments-alt mr-1"></i>Reply</a> <span>|</span> <span data-controller="tooltip" data-tooltip-offset-value="10" data-tooltip-placement-value="bottom" data-action="focusin->tooltip#mouseEnter focusout->tooltip#mouseLeave" > <a href="#share-478" title="Share Comment Link" data-action="comment#share" data-target-url="https://symfonycasts.com/screencast/twig#comment-478"><i class="fal fa-share-alt"></i></a> <div data-tooltip-target="block" class=" hidden absolute z-50 inline-block p-2 text-sm text-gray-500 duration-300 bg-white border border-gray-200 rounded-lg shadow-sm dark:text-gray-400 dark:bg-gray-800 dark:border-gray-600"> <div class="text-center" data-tooltip-target="content">Share Comment</div> <div data-tooltip-target="arrow" class="w-[10px] h-[10px] z-10 absolute bg-white border-t border-l border-gray-200 dark:border-gray-600 dark:bg-gray-800"></div> </div> </span> </div> </div> </div> </div> </div> </turbo-frame> </turbo-frame> </div> <div data-controller="modal" data-action="turbo:before-cache@window->modal#close modal:open->modal#open modal:close->modal#close" data-comment-target="deleteConfirmModal" > <dialog class="open:flex p-0 bg-white dark:bg-black-9 text-left shadow-xl transform rounded-lg shadow-xl inset-0 w-full md:w-fit md:max-w-[50%] md:min-w-[50%] animate-fade-in backdrop:bg-slate-600 backdrop:bg-opacity-80 backdrop:backdrop-blur-sm" data-modal-target="dialog" data-action="close->modal#close click->modal#clickOutside" > <div class="flex grow"> <div class="grow overflow-auto justify-center items-center"> <h3 class="p-4 text-2xl text-center font-medium text-black-9 dark:text-white"> Delete comment? </h3> <div class="p-4 flex gap-2 justify-center"> <button data-action="comment#doDelete" class="btn-blue-sm bg-context-orange hover:bg-context-darkred my-3"><i class="fa fa-trash pr-1"></i>Delete</button> <button data-action="modal#close" class="btn-blue-sm my-3"><i class="fa fa-xmark pr-1"></i>Cancel</button> </div> </div> <button class="absolute right-4 top-4 dark:text-white flex items-center opacity-70 transition-opacity hover:opacity-100" data-action="modal#close" type="button" > <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 6l-12 12" /><path d="M6 6l12 12" /></svg> </button> </div> </dialog> </div> <div class="js-comment-share-modal"> <div data-controller="modal" data-action="turbo:before-cache@window->modal#close modal:open->modal#open modal:close->modal#close" > <dialog class="open:flex p-0 bg-white dark:bg-black-9 text-left shadow-xl transform rounded-lg shadow-xl inset-0 w-full md:w-fit md:max-w-[50%] md:min-w-[50%] animate-fade-in backdrop:bg-slate-600 backdrop:bg-opacity-80 backdrop:backdrop-blur-sm" data-modal-target="dialog" data-action="close->modal#close click->modal#clickOutside" > <div class="flex grow"> <div class="grow overflow-auto justify-center items-center"> <h3 class="p-4 text-2xl text-center font-medium text-black-9 dark:text-white border-b border-black-3 dark:border-black-6"> Share this comment </h3> <div class="m-3"> <input class="bg-black-1 border dark:border-black-7 border-black-2 text-black-5 text-sm rounded-lg focus:ring-transparent focus:border-none p-2 dark:bg-black-7 dark:placeholder-black-5 dark:text-white dark:focus:ring-transparent dark:focus:border-none" type="text" readonly style="width: 100%"> </div> <div class="px-4 py-2 flex gap-2 justify-center"> <button data-action="comment#copyShareUrl" class="js-copy-share-url-btn btn-blue-sm my-3"><i class="fa fa-copy pr-1"></i>Copy link</button> <button data-action="modal#close" class="btn-secondary-sm my-3"><i class="fa fa-xmark pr-1"></i>Cancel</button> </div> </div> <button class="absolute right-4 top-4 dark:text-white flex items-center opacity-70 transition-opacity hover:opacity-100" data-action="modal#close" type="button" > <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 6l-12 12" /><path d="M6 6l12 12" /></svg> </button> </div> </dialog> </div> </div> <div data-comment-target="noCommentsMessage" style="display: none;"> <div class=""> <img class="mx-auto w-36" src="https://symfonycasts.com/build/images/planet-astronaut.b2e6de60.png" alt="astronaut with balloons in space" loading="lazy"> <p class="text-center mt-4 ml-2"><span class="font-semibold">"Houston: no signs of life" </span><br> <span class="mt-2">Start the conversation!</span></p> </div> </div> </div> </div> <!-- Closes the Course Comments Section --> </div> </div> </div> </div> </main> <footer class="my-10 max-w-7xl mx-auto border-t border-black-2 dark:border-black-6 px-5"> <section class="flex flex-col md:flex-row md:justify-between mb-16 pt-11"> <div> <div class="bg-[url('../images/symfonycasts-logo-dm.svg')] w-[65px] h-[55px] bg-cover bg-no-repeat" alt="SymfonyCasts Logo"></div> <div class="text-[32px] font-semibold mt-4 mb-8 dark:text-white">Where learning is really fun.</div> <div class="text-xs min-[500px]:text-base flex"> <div><a href="/contact" class="btn-secondary-lg whitespace-nowrap">Get in touch<i class="fa-solid fa-envelope pl-2.5"></i></a></div> <div><a href="/pricing" class="btn-blue-lg ml-3 whitespace-nowrap">All Access Pass<i class="fa-solid fa-bolt-lightning pl-2.5"></i></a></div> </div> </div> <div class="flex flex-row mt-6 md:mt-0"> <div class="mr-16"> <ul class="text-[22px] font-semibold dark:text-white"> <li class="pb-3"><a href="/courses#all" class="hover:text-blue-6">Courses</a></li> <li class="pb-3"><a href="/courses#tracks" class="hover:text-blue-6">Tracks</a></li> <li class="pb-3"><a href="/pricing" class="hover:text-blue-6">Pricing</a></li> <li class="pb-3"><a href="/gift-card/" class="hover:text-blue-6">Gift Card</a></li> <li class="pb-3"><a href="/blog" class="hover:text-blue-6">Blog</a></li> </ul> </div> <div> <ul class="text-sm pt-2.5 dark:text-black-4"> <li class="pb-3"><a href="/faq" class="hover:text-blue-6">FAQ</a></li> <li class="pb-3"><a href="/faq" class="hover:text-blue-6">About</a></li> <li class="pb-3"><a href="/terms" class="hover:text-blue-6">Terms</a> <span>&</span> <a href="/privacy" class="hover:text-blue-6">Privacy</a></li> <li class="pb-3"><a href="/courses?status=upcoming&sort=popular#all" class="hover:text-blue-6">Roadmap</a></li> <li class="pb-3"><a href="/contact" class="hover:text-blue-6">Contact</a></li> </ul> </div> </div> </section> <section class="flex flex-col md:flex-row md:justify-between"> <div class="dark:text-white"> <a href="https://github.com/SymfonyCasts" class="hover:text-blue-6"><i class="fa-brands fa-github pr-8"></i></a> <a href="https://twitter.com/SymfonyCasts" class="hover:text-blue-6"><i class="fa-brands fa-x-twitter pr-8"></i></a> <a href="https://www.facebook.com/SymfonyCasts/" class="hover:text-blue-6"><i class="fa-brands fa-facebook-f pr-8"></i></a> <a href="https://www.linkedin.com/company/symfonycasts/" class="hover:text-blue-6"><i class="fa-brands fa-linkedin pr-8"></i></a> <span>Powered by <span class="text-blue-6">KnpUniversity</span></span> </div> <div> <p class="dark:text-black-4 mt-6 md:mt-0">Hosted with <i class="fa-solid fa-heart text-red-600"></i> on <a href="https://symfony.com/cloud/" class="underline hover:text-blue-6">platform.sh</a></p> </div> </section> </footer> </body> </html>