Include fichier css dans html.twig symfony 2 templatei
Linaro
Messages postés
14
Statut
Membre
-
Somaxone Messages postés 2 Statut Membre -
Somaxone Messages postés 2 Statut Membre -
Bonjour,
je suis débutant en symfony2 j'ai crée un nouveau bundle HtmlBundle pour et j' ai essayé d'inclure une fichier css dans un fichier html.twig et ça marche marche elle ne donne pas aucune résultat .
fichier css : src/Tuto/HtmlBundle/public/css/style.css
fichier html.twig : src/Tuto/HtmlBundle/Resources/views/Public/index.html.twig
*************************index.htm.twig**************
<head>
<meta charset="utf-8">
<title>Html + CSS in Symfony PHP Project</title>
{% block stylesheets %}
<link href="{{ asset('bundles/tutohtml/css/style.css') }}" rel="stylesheet" />
{% endblock %}
</head>
<body>
<div class="container">
<section id="content">
<form action="">
<h1>Login Form</h1>
<div>
<input type="text" placeholder="Username" required="" id="username" />
</div>
<div>
<input type="password" placeholder="Password" required="" id="password" />
</div>
<div>
<input type="submit" value="Log in" />
<a href="#">Lost your password?</a>
<a href="#">Register</a>
</div>
</form><!-- form -->
<div class="button">
<a href="#">Download source file</a>
</div><!-- button -->
</section><!-- content -->
</div><!-- container -->
</body>
</html>
-------------------------------------------------------
encore j'ai excécuté la commande php app/console assets:install web --symlink
rien ne change et il n' y' pas d'effet de css dans le navigateur
je suis débutant en symfony2 j'ai crée un nouveau bundle HtmlBundle pour et j' ai essayé d'inclure une fichier css dans un fichier html.twig et ça marche marche elle ne donne pas aucune résultat .
fichier css : src/Tuto/HtmlBundle/public/css/style.css
fichier html.twig : src/Tuto/HtmlBundle/Resources/views/Public/index.html.twig
*************************index.htm.twig**************
<head>
<meta charset="utf-8">
<title>Html + CSS in Symfony PHP Project</title>
{% block stylesheets %}
<link href="{{ asset('bundles/tutohtml/css/style.css') }}" rel="stylesheet" />
{% endblock %}
</head>
<body>
<div class="container">
<section id="content">
<form action="">
<h1>Login Form</h1>
<div>
<input type="text" placeholder="Username" required="" id="username" />
</div>
<div>
<input type="password" placeholder="Password" required="" id="password" />
</div>
<div>
<input type="submit" value="Log in" />
<a href="#">Lost your password?</a>
<a href="#">Register</a>
</div>
</form><!-- form -->
<div class="button">
<a href="#">Download source file</a>
</div><!-- button -->
</section><!-- content -->
</div><!-- container -->
</body>
</html>
-------------------------------------------------------
encore j'ai excécuté la commande php app/console assets:install web --symlink
rien ne change et il n' y' pas d'effet de css dans le navigateur
A voir également:
- Include fichier css dans html.twig symfony 2 templatei
- Fichier bin - Guide
- Fichier epub - Guide
- Fichier rar - Guide
- Comment réduire la taille d'un fichier - Guide
- Fichier .dat - Guide