initial commit
This commit is contained in:
25
vendor/symfony/maker-bundle/templates/controller/Controller.tpl.php
vendored
Normal file
25
vendor/symfony/maker-bundle/templates/controller/Controller.tpl.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?= "<?php\n" ?>
|
||||
|
||||
namespace <?= $class_data->getNamespace(); ?>;
|
||||
|
||||
<?= $class_data->getUseStatements(); ?>
|
||||
|
||||
<?= $class_data->getClassDeclaration(); ?>
|
||||
|
||||
{
|
||||
<?= $generator->generateRouteForControllerMethod($route_path, $route_name); ?>
|
||||
public function <?= $method_name ?>(): <?php if ($with_template) { ?>Response<?php } else { ?>JsonResponse<?php } ?>
|
||||
|
||||
{
|
||||
<?php if ($with_template) { ?>
|
||||
return $this->render('<?= $template_name ?>', [
|
||||
'controller_name' => '<?= $class_data->getClassName() ?>',
|
||||
]);
|
||||
<?php } else { ?>
|
||||
return $this->json([
|
||||
'message' => 'Welcome to your new controller!',
|
||||
'path' => '<?= $relative_path; ?>',
|
||||
]);
|
||||
<?php } ?>
|
||||
}
|
||||
}
|
||||
17
vendor/symfony/maker-bundle/templates/controller/test/Test.tpl.php
vendored
Normal file
17
vendor/symfony/maker-bundle/templates/controller/test/Test.tpl.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?= "<?php\n" ?>
|
||||
|
||||
namespace <?= $class_data->getNamespace(); ?>;
|
||||
|
||||
<?= $class_data->getUseStatements(); ?>
|
||||
|
||||
<?= $class_data->getClassDeclaration(); ?>
|
||||
|
||||
{
|
||||
public function testIndex(): void
|
||||
{
|
||||
$client = static::createClient();
|
||||
$client->request('GET', '<?= $route_path; ?>');
|
||||
|
||||
self::assertResponseIsSuccessful();
|
||||
}
|
||||
}
|
||||
18
vendor/symfony/maker-bundle/templates/controller/twig_template.tpl.php
vendored
Normal file
18
vendor/symfony/maker-bundle/templates/controller/twig_template.tpl.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?= $helper->getHeadPrintCode("Hello $class_name!"); ?>
|
||||
|
||||
{% block body %}
|
||||
<style>
|
||||
.example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
|
||||
.example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
|
||||
</style>
|
||||
|
||||
<div class="example-wrapper">
|
||||
<h1>Hello {{ controller_name }}! ✅</h1>
|
||||
|
||||
This friendly message is coming from:
|
||||
<ul>
|
||||
<li>Your controller at <code><?= $root_directory ?>/<?= $controller_path ?></code></li>
|
||||
<li>Your template at <code><?= $root_directory ?>/<?= $relative_path ?></code></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user