Browse Source

init template

master
ghost 9 months ago
parent
commit
35368eb229
  1. 4
      .env
  2. 7
      composer.json
  3. 418
      composer.lock
  4. 2
      config/bundles.php
  5. 12
      config/packages/twig.yaml
  6. 3
      config/services.yaml
  7. 203
      public/css/default.css
  8. 33
      src/Controller/MainController.php
  9. 16
      symfony.lock
  10. 4
      templates/default/main/index.html.twig
  11. 12
      templates/layout.html.twig

4
.env

@ -18,3 +18,7 @@ @@ -18,3 +18,7 @@
APP_ENV=dev
APP_SECRET=EDIT_ME
###< symfony/framework-bundle ###
APP_VERSION="1.0.0"
APP_THEME="default"
APP_NAME="KVAZAR"

7
composer.json

@ -12,9 +12,10 @@ @@ -12,9 +12,10 @@
"symfony/flex": "^2",
"symfony/framework-bundle": "7.0.*",
"symfony/runtime": "7.0.*",
"symfony/yaml": "7.0.*"
},
"require-dev": {
"symfony/twig-bundle": "7.0.*",
"symfony/yaml": "7.0.*",
"twig/extra-bundle": "^2.12|^3.0",
"twig/twig": "^2.12|^3.0"
},
"config": {
"allow-plugins": {

418
composer.lock generated

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "e35f3617f3b9fbf8a1fd858641bffd14",
"content-hash": "efed3de4393079f8b609bebb4a9d2a58",
"packages": [
{
"name": "psr/cache",
@ -2171,6 +2171,276 @@ @@ -2171,6 +2171,276 @@
],
"time": "2024-01-29T15:41:16+00:00"
},
{
"name": "symfony/translation-contracts",
"version": "v3.4.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation-contracts.git",
"reference": "06450585bf65e978026bda220cdebca3f867fde7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/translation-contracts/zipball/06450585bf65e978026bda220cdebca3f867fde7",
"reference": "06450585bf65e978026bda220cdebca3f867fde7",
"shasum": ""
},
"require": {
"php": ">=8.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "3.4-dev"
},
"thanks": {
"name": "symfony/contracts",
"url": "https://github.com/symfony/contracts"
}
},
"autoload": {
"psr-4": {
"Symfony\\Contracts\\Translation\\": ""
},
"exclude-from-classmap": [
"/Test/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Generic abstractions related to translation",
"homepage": "https://symfony.com",
"keywords": [
"abstractions",
"contracts",
"decoupling",
"interfaces",
"interoperability",
"standards"
],
"support": {
"source": "https://github.com/symfony/translation-contracts/tree/v3.4.1"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2023-12-26T14:02:43+00:00"
},
{
"name": "symfony/twig-bridge",
"version": "v7.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/twig-bridge.git",
"reference": "414ff6930889262a11ec67f351e9810dd8565b0d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/twig-bridge/zipball/414ff6930889262a11ec67f351e9810dd8565b0d",
"reference": "414ff6930889262a11ec67f351e9810dd8565b0d",
"shasum": ""
},
"require": {
"php": ">=8.2",
"symfony/translation-contracts": "^2.5|^3",
"twig/twig": "^3.0.4"
},
"conflict": {
"phpdocumentor/reflection-docblock": "<3.2.2",
"phpdocumentor/type-resolver": "<1.4.0",
"symfony/console": "<6.4",
"symfony/form": "<6.4",
"symfony/http-foundation": "<6.4",
"symfony/http-kernel": "<6.4",
"symfony/mime": "<6.4",
"symfony/serializer": "<6.4",
"symfony/translation": "<6.4",
"symfony/workflow": "<6.4"
},
"require-dev": {
"egulias/email-validator": "^2.1.10|^3|^4",
"league/html-to-markdown": "^5.0",
"phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0",
"symfony/asset": "^6.4|^7.0",
"symfony/asset-mapper": "^6.4|^7.0",
"symfony/console": "^6.4|^7.0",
"symfony/dependency-injection": "^6.4|^7.0",
"symfony/expression-language": "^6.4|^7.0",
"symfony/finder": "^6.4|^7.0",
"symfony/form": "^6.4|^7.0",
"symfony/html-sanitizer": "^6.4|^7.0",
"symfony/http-foundation": "^6.4|^7.0",
"symfony/http-kernel": "^6.4|^7.0",
"symfony/intl": "^6.4|^7.0",
"symfony/mime": "^6.4|^7.0",
"symfony/polyfill-intl-icu": "~1.0",
"symfony/property-info": "^6.4|^7.0",
"symfony/routing": "^6.4|^7.0",
"symfony/security-acl": "^2.8|^3.0",
"symfony/security-core": "^6.4|^7.0",
"symfony/security-csrf": "^6.4|^7.0",
"symfony/security-http": "^6.4|^7.0",
"symfony/serializer": "^6.4.3|^7.0.3",
"symfony/stopwatch": "^6.4|^7.0",
"symfony/translation": "^6.4|^7.0",
"symfony/web-link": "^6.4|^7.0",
"symfony/workflow": "^6.4|^7.0",
"symfony/yaml": "^6.4|^7.0",
"twig/cssinliner-extra": "^2.12|^3",
"twig/inky-extra": "^2.12|^3",
"twig/markdown-extra": "^2.12|^3"
},
"type": "symfony-bridge",
"autoload": {
"psr-4": {
"Symfony\\Bridge\\Twig\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Provides integration for Twig with various Symfony components",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/twig-bridge/tree/v7.0.3"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2024-01-30T08:34:29+00:00"
},
{
"name": "symfony/twig-bundle",
"version": "v7.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/twig-bundle.git",
"reference": "6fbf0cc2b0d0208be4881ff6069665687396b323"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/twig-bundle/zipball/6fbf0cc2b0d0208be4881ff6069665687396b323",
"reference": "6fbf0cc2b0d0208be4881ff6069665687396b323",
"shasum": ""
},
"require": {
"composer-runtime-api": ">=2.1",
"php": ">=8.2",
"symfony/config": "^6.4|^7.0",
"symfony/dependency-injection": "^6.4|^7.0",
"symfony/http-foundation": "^6.4|^7.0",
"symfony/http-kernel": "^6.4|^7.0",
"symfony/twig-bridge": "^6.4|^7.0",
"twig/twig": "^3.0.4"
},
"conflict": {
"symfony/framework-bundle": "<6.4",
"symfony/translation": "<6.4"
},
"require-dev": {
"symfony/asset": "^6.4|^7.0",
"symfony/expression-language": "^6.4|^7.0",
"symfony/finder": "^6.4|^7.0",
"symfony/form": "^6.4|^7.0",
"symfony/framework-bundle": "^6.4|^7.0",
"symfony/routing": "^6.4|^7.0",
"symfony/stopwatch": "^6.4|^7.0",
"symfony/translation": "^6.4|^7.0",
"symfony/web-link": "^6.4|^7.0",
"symfony/yaml": "^6.4|^7.0"
},
"type": "symfony-bundle",
"autoload": {
"psr-4": {
"Symfony\\Bundle\\TwigBundle\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Provides a tight integration of Twig into the Symfony full-stack framework",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/twig-bundle/tree/v7.0.3"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2024-01-23T15:02:46+00:00"
},
{
"name": "symfony/var-dumper",
"version": "v7.0.3",
@ -2398,6 +2668,152 @@ @@ -2398,6 +2668,152 @@
}
],
"time": "2024-01-23T15:02:46+00:00"
},
{
"name": "twig/extra-bundle",
"version": "v3.8.0",
"source": {
"type": "git",
"url": "https://github.com/twigphp/twig-extra-bundle.git",
"reference": "32807183753de0388c8e59f7ac2d13bb47311140"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/twig-extra-bundle/zipball/32807183753de0388c8e59f7ac2d13bb47311140",
"reference": "32807183753de0388c8e59f7ac2d13bb47311140",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"symfony/framework-bundle": "^5.4|^6.0|^7.0",
"symfony/twig-bundle": "^5.4|^6.0|^7.0",
"twig/twig": "^3.0"
},
"require-dev": {
"league/commonmark": "^1.0|^2.0",
"symfony/phpunit-bridge": "^6.4|^7.0",
"twig/cache-extra": "^3.0",
"twig/cssinliner-extra": "^2.12|^3.0",
"twig/html-extra": "^2.12|^3.0",
"twig/inky-extra": "^2.12|^3.0",
"twig/intl-extra": "^2.12|^3.0",
"twig/markdown-extra": "^2.12|^3.0",
"twig/string-extra": "^2.12|^3.0"
},
"type": "symfony-bundle",
"autoload": {
"psr-4": {
"Twig\\Extra\\TwigExtraBundle\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com",
"homepage": "http://fabien.potencier.org",
"role": "Lead Developer"
}
],
"description": "A Symfony bundle for extra Twig extensions",
"homepage": "https://twig.symfony.com",
"keywords": [
"bundle",
"extra",
"twig"
],
"support": {
"source": "https://github.com/twigphp/twig-extra-bundle/tree/v3.8.0"
},
"funding": [
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/twig/twig",
"type": "tidelift"
}
],
"time": "2023-11-21T14:02:01+00:00"
},
{
"name": "twig/twig",
"version": "v3.8.0",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/9d15f0ac07f44dc4217883ec6ae02fd555c6f71d",
"reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"symfony/polyfill-ctype": "^1.8",
"symfony/polyfill-mbstring": "^1.3",
"symfony/polyfill-php80": "^1.22"
},
"require-dev": {
"psr/container": "^1.0|^2.0",
"symfony/phpunit-bridge": "^5.4.9|^6.3|^7.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Twig\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com",
"homepage": "http://fabien.potencier.org",
"role": "Lead Developer"
},
{
"name": "Twig Team",
"role": "Contributors"
},
{
"name": "Armin Ronacher",
"email": "armin.ronacher@active-4.com",
"role": "Project Founder"
}
],
"description": "Twig, the flexible, fast, and secure template language for PHP",
"homepage": "https://twig.symfony.com",
"keywords": [
"templating"
],
"support": {
"issues": "https://github.com/twigphp/Twig/issues",
"source": "https://github.com/twigphp/Twig/tree/v3.8.0"
},
"funding": [
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/twig/twig",
"type": "tidelift"
}
],
"time": "2023-11-21T18:54:41+00:00"
}
],
"packages-dev": [],

2
config/bundles.php

@ -2,4 +2,6 @@ @@ -2,4 +2,6 @@
return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
];

12
config/packages/twig.yaml

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
twig:
file_name_pattern: '*.twig'
default_path: '%kernel.project_dir%/templates'
globals:
app:
version: '%app.version%'
theme: '%app.theme%'
name: '%app.name%'
when@test:
twig:
strict_variables: true

3
config/services.yaml

@ -4,6 +4,9 @@ @@ -4,6 +4,9 @@
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
parameters:
app.version: '%env(APP_VERSION)%'
app.theme: '%env(APP_THEME)%'
app.name: '%env(APP_NAME)%'
services:
# default configuration for services in *this* file

203
public/css/default.css

@ -0,0 +1,203 @@ @@ -0,0 +1,203 @@
button::-moz-focus-inner {
border: 0;
padding: 0;
margin-top:-2px;
margin-bottom: -2px;
}
* {
padding: 0;
margin: 0;
}
input, button {
opacity: 0.8;
color: #000;
background: #ABA6B7;
border: 0;
border-radius: 3px;
height: 18px;
line-height: 18px;
outline: none;
text-align: center;
}
body {
color: #BFBACC;
background-color: #000;
font-family: Sans-Serif, Arial;
font-size: 14px;
font-weight: normal;
line-height: 1.8;
}
a {
color: #ABA6B7;
text-decoration: none;
-moz-transition: all .5s ease-in;
-o-transition: all .5s ease-in;
/* issue #2
-webkit-transition: all .5s ease-in;
transition: all .5s ease-in; */
}
a:hover {
color: #BFBACC;
-webkit-transition: all .5s ease-in; /* issue #2 */
}
img {
opacity: 0.8;
-moz-transition: all .5s ease-in;
-o-transition: all .5s ease-in;
-webkit-transition: all .5s ease-in;
transition: all .5s ease-in;
}
img.shine,
img:hover {
opacity: 1
}
.logo {
font-size: 20px;
letter-spacing: .2em;
margin-right:-.2em;
}
.d-block {
display: block;
}
.of-a {
overflow: auto
}
.f-s-12 {
font-size: 12px;
}
.f-s-16 {
font-size: 16px;
}
.f-s-20 {
font-size: 18px;
}
.t-center {
text-align: center;
}
.b-g::before {
content: "";
background-image: linear-gradient(to left, #9B94BF, #000);
height: 1px;
width: 50%;
max-width: 360px;
display: inline-block;
}
.b-g::after {
content: "";
background-image: linear-gradient(to right, #9B94BF, #000);
height: 1px;
width: 50%;
max-width: 360px;
display: inline-block;
}
.br-50 {
border-radius: 50%;
}
.c-0,
.c-0:active,
.c-0:visited,
.c-0:hover {
color: #FFF;
}
.c-1,
.c-1:active,
.c-1:visited,
.c-1:hover {
color: #BFBACC;
}
.c-2,
.c-2:active,
.c-2:visited,
.c-2:hover {
color: #9ba5af;
}
.cursor-pointer {
cursor: pointer;
}
.p-8 {
padding: 8px;
}
@-moz-document url-prefix() {
.p-8 {
padding: 4px;
}
}
.px-16 {
padding-left: 16px;
padding-right: 16px;
}
.py-27 {
padding-top: 27px;
padding-bottom: 27px;
}
.py-54 {
padding-top: 54px;
padding-bottom: 54px;
}
.pt-27 {
padding-top: 27px;
}
.pt-54 {
padding-top: 54px;
}
.pb-16 {
padding-bottom: 16px;
}
.pb-27 {
padding-bottom: 27px;
}
.pb-36 {
padding-bottom: 36px;
}
.mx-a {
margin-left: auto;
margin-right: auto;
}
.mb-16 {
margin-bottom: 16px
}
.mb-20 {
margin-bottom: 20px
}
.mb-36 {
margin-bottom: 36px
}
.mw-560 {
max-width: 560px;
}

33
src/Controller/MainController.php

@ -0,0 +1,33 @@ @@ -0,0 +1,33 @@
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Contracts\Translation\TranslatorInterface;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
class MainController extends AbstractController
{
#[Route(
'/',
name: 'main_index',
methods:
[
'GET'
]
)]
public function index(
?Request $request
): Response
{
return $this->render(
'default/main/index.html.twig',
[
'request' => $request
]
);
}
}

16
symfony.lock

@ -54,5 +54,21 @@ @@ -54,5 +54,21 @@
"config/packages/routing.yaml",
"config/routes.yaml"
]
},
"symfony/twig-bundle": {
"version": "7.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "6.4",
"ref": "cab5fd2a13a45c266d45a7d9337e28dee6272877"
},
"files": [
"config/packages/twig.yaml",
"templates/base.html.twig"
]
},
"twig/extra-bundle": {
"version": "v3.8.0"
}
}

4
templates/default/main/index.html.twig

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
{% extends 'layout.html.twig' %}
{% block body %}
{{ app.name }}
{% endblock %}

12
templates/layout.html.twig

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>{% block title %}{{ app.name }}{% endblock %}</title>
<link rel="stylesheet" type="text/css" href="/css/{{ app.theme }}.css?{{ app.version }}" />
<link rel="icon" href="{% block favicon %}/favicon.ico{% endblock %}" />
</head>
<body>
{% block body %}{% endblock %}
</body>
</html>
Loading…
Cancel
Save