GithubHelp home page GithubHelp logo

symfony6-static-movies's Introduction

Laravel 8 Complete Blog

This repository is linked to this youtube series where I teach the fundamentals of Symfony 6. For this course, we'll be creating a mini crud application and to save us some time, I created the complete frontend inside the templates/ folder.

• Author: Code With Dary
• Twitter: @codewithdary
• Instagram: @codewithdary

symfony6-static-movies's People

Contributors

codewithdary avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

symfony6-static-movies's Issues

introduce tags of course steps

Hy Dary,
thank you so much for yor Symfony 6 course!
May I ask you to adde the full code may be divided into the steps you explain things in your Youtube video ? This would be very useful to checke the code we wrote while following the course. Thank you in advance.

Redips.

symfony6-static-movies

The static content not availble in index.html.twig file all that mention for each loop geting twig variable and the respective value for image, title, description from db data but your course and youtube file showing as static content kindly check bro..

Variable "movies" does not exist.

Variable "movies" does not exist.
ExceptionStack Trace
Twig\Error
RuntimeError
in E:\dev\htdocs_link\movies\templates\movies\index.html.twig (line 7)
{% block body %}


Movies Review ({{ movies|length }})

symfony error

Created by Code With Dary

MoviesController.php

render('movies/index.html.twig'); } } ?>

index.html.twig full code

{% extends "./base.html.twig" %}

{% block body %}




Movies Review ({{ movies|length }})

        <span class="font-light text-gray-500 italic">
            Created by Code With Dary
        </span>
    </div>
</div>

<div class="mx-auto w-4/5 my-8">
    <a 
        href="/movies/create" 
        class="uppercase border border-gray-500 text-lg py-4 px-6 rounded transition transition-all bg-gray-800 text-white hover:bg-white hover:text-gray-800">
        Create New movie
    </a>
</div>
<div class="md:grid lg:grid-cols-3 gap-20 w-4/5 mx-auto py-15 ">
    <!-- Review Item -->
    {% for movie in movies %}
        <div class="text-center pt-8 pb-4">
            <img
                src="{{ movie.imagePath }}"
                alt=""
                class="shadow-xl rounded-md"
            />

            <h2 class="text-gray-700 font-bold text-3xl py-2">
                {{ movie.title }}
            </h2>

            <span class="text-gray-500">
                By <span class="italic text-sm text-gray-800">Code With Dary | 28.01.2022
            </span>

            <p class="text-base text-gray-700 pt-4 pb-10 leading-8 font-light">
                {{ movie.description }}
            </p>

            <a href="/movies/{{ movie.id }}" class="uppercase border border-gray-500 text-gray-600 text-lg py-4 px-12 rounded transition transition-all hover:bg-gray-800 hover:text-white">
                Keep Reading
            </a>
        </div>
    {% endfor %}
</div>

{% endblock %}

base.html.twig becase we extended class

<title>{% block title %}Welcome!{% endblock %}</title> {% block stylesheets %}{% endblock %} {% block javascripts %}{{ encore_entry_script_tags('app') }}{% endblock %} <script src="https://cdn.tailwindcss.com"></script> <script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.min.js" defer></script> {% block header %}
                    <div class="flex items-center flex-shrink-0 text-white mr-6">
                        <a
                                class="text-white no-underline hover:text-white hover:no-underline"
                                href="/">
        <span class="text-2xl pl-2 font-extrabold">
            Movies
        </span>
                        </a>
                    </div>

                    <button
                            @click="isOpen = !isOpen"
                            type="button"
                            class="block lg:hidden px-2 text-gray-500 hover:text-white focus:outline-none focus:text-white"
                            :class="{ 'transition transform-180': isOpen }">

                        <svg
                                class="h-6 w-6 fill-current"
                                xmlns="http://www.w3.org/2000/svg"
                                viewBox="0 0 24 24">

                            <path
                                    x-show="isOpen"
                                    fill-rule="evenodd"
                                    clip-rule="evenodd"
                                    d="M18.278 16.864a1 1 0 0 1-1.414 1.414l-4.829-4.828-4.828 4.828a1 1 0 0 1-1.414-1.414l4.828-4.829-4.828-4.828a1 1 0 0 1 1.414-1.414l4.829 4.828 4.828-4.828a1 1 0 1 1 1.414 1.414l-4.828 4.829 4.828 4.828z"
                            />

                            <path
                                    x-show="!isOpen"
                                    fill-rule="evenodd"
                                    d="M4 5h16a1 1 0 0 1 0 2H4a1 1 0 1 1 0-2zm0 6h16a1 1 0 0 1 0 2H4a1 1 0 0 1 0-2zm0 6h16a1 1 0 0 1 0 2H4a1 1 0 0 1 0-2z"
                            />
                        </svg>
                    </button>

                    <div
                            class="w-full flex-grow lg:flex lg:items-center lg:w-auto"
                            :class="{ 'block shadow-3xl': isOpen, 'hidden': !isOpen }"
                            @click.away="isOpen = false"
                            x-show.transition="true">

                        <ul class="pt-6 lg:pt-0 list-reset lg:flex justify-end flex-1 items-center">
                            <li class="mr-3">
                                <a
                                        class="inline-block text-gray-300 no-underline hover:text-gray-200 hover:text-underline py-2 px-4"
                                        href="/"
                                        @click="isOpen = false">
                                    Home
                                </a>
                            </li>

                            <li class="mr-3">
                                <a
                                        class="inline-block text-gray-300 no-underline hover:text-gray-200 hover:text-underline py-2 px-4"
                                        href="/movies"
                                        @click="isOpen = false"
                                >Movies
                                </a>
                            </li>

                            <li class="mr-3">
                                <a
                                        class="inline-block text-gray-300 no-underline hover:text-gray-200 hover:text-underline py-2 px-4"
                                        href="/contact"
                                        @click="isOpen = false">
                                    Contact
                                </a>
                            </li>
                        </ul>
                    </div>
                </nav>
            </header>
        {% endblock %}

        {% block body %}{% endblock %}

        {% block footer %}
            <footer class="bg-gray-600 py-6 mt-20">
                <p class="w-25 w-4/5 text-center pb-3 m-auto text-base text-gray-100 pt-6">
                    Copyright 2021 Code With Dary. All Rights Reserved
                </p>
            </footer>
        {% endblock %}
</body>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.