-
-
Notifications
You must be signed in to change notification settings - Fork 404
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add starter-kit that includes all current scaffolds and and applicati…
…on shell
- Loading branch information
Showing
4 changed files
with
99 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
use Symfony\Bundle\MakerBundle\FileManager; | ||
|
||
return [ | ||
'description' => 'Starting kit with authentication, registration, password reset, user profile management with an application shell styled with Bootstrap CSS.', | ||
'dependents' => [ | ||
'bootstrapcss', | ||
'register', | ||
'reset-password', | ||
'change-password', | ||
'profile', | ||
], | ||
'configure' => function(FileManager $files) { | ||
$files->dumpFile('templates/base.html.twig', file_get_contents(__DIR__.'/starter-kit/templates/base.html.twig')); | ||
|
||
$login = $files->getFileContents('templates/login.html.twig'); | ||
$forgotPassword = "</button>\n <a class=\"btn btn-link\" href=\"{{ path('reset_password_request') }}\">Forgot your password?</a>"; | ||
|
||
if (str_contains($login, $forgotPassword)) { | ||
return; | ||
} | ||
|
||
$files->dumpFile('templates/login.html.twig', str_replace( | ||
'</button>', | ||
$forgotPassword, | ||
$login | ||
)); | ||
}, | ||
]; |
53 changes: 53 additions & 0 deletions
53
src/Resources/scaffolds/6.0/starter-kit/templates/base.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>{% block title %}Welcome!{% endblock %}</title> | ||
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text></svg>"> | ||
{# Run `composer require symfony/webpack-encore-bundle` to start using Symfony UX #} | ||
{% block stylesheets %} | ||
{{ encore_entry_link_tags('app') }} | ||
{% endblock %} | ||
|
||
{% block javascripts %} | ||
{{ encore_entry_script_tags('app') }} | ||
{% endblock %} | ||
</head> | ||
<body> | ||
<nav class="navbar navbar-expand-lg navbar-light bg-light mb-3"> | ||
<div class="container"> | ||
<a class="navbar-brand" href="{{ path('homepage') }}">My App</a> | ||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
<div class="collapse navbar-collapse" id="navbarSupportedContent"> | ||
<ul class="navbar-nav ms-auto mb-2 mb-lg-0"> | ||
{% if app.user %} | ||
<li class="nav-item dropdown"> | ||
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"> | ||
{{ app.user.email }} | ||
</a> | ||
<ul class="dropdown-menu" aria-labelledby="navbarDropdown"> | ||
<li><a class="dropdown-item" href="{{ path('profile') }}">Manage Profile</a></li> | ||
<li><a class="dropdown-item" href="{{ path('change_password') }}">Change Password</a></li> | ||
<li><hr class="dropdown-divider"></li> | ||
<li><a class="dropdown-item" href="{{ path('logout') }}">Logout</a></li> | ||
</ul> | ||
</li> | ||
{% else %} | ||
<li class="nav-item"> | ||
<a class="nav-link" href="{{ path('register') }}">Register</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="{{ path('login') }}">Login</a> | ||
</li> | ||
{% endif %} | ||
</ul> | ||
</div> | ||
</div> | ||
</nav> | ||
<div class="container"> | ||
{% block body %}{% endblock %} | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters