Skip to content

Commit 40c48d6

Browse files
committed
Simplified examples
1 parent d4c5502 commit 40c48d6

23 files changed

Lines changed: 24 additions & 46 deletions

File tree

tests/_data/routes/articles/[id]/comments.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
/** @var tebe\zack\routing\PhpRouteHandler $this */
44

5-
return $this->html('articles/comments.html.twig', [
5+
return $this->render('articles/comments.html.twig', [
66
'title' => 'GET: Articles.[id].Comments.Php',
77
]);

tests/_data/routes/articles/[id]/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
/** @var tebe\zack\routing\PhpRouteHandler $this */
44

5-
return $this->html('articles/detail.html.twig', [
5+
return $this->render('articles/detail.html.twig', [
66
'title' => 'GET: Articles.[id].Php',
77
]);

tests/_data/routes/articles/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
/** @var tebe\zack\routing\PhpRouteHandler $this */
44

5-
return $this->html('articles/list.html.twig', [
5+
return $this->render('articles/list.html.twig', [
66
'title' => 'GET: Articles.Php',
77
]);

tests/_data/routes/doc-examples/hello/[name].php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
/** @var Symfony\Component\HttpFoundation\Request $request */
44

5-
use Symfony\Component\HttpFoundation\Response;
6-
75
$name = $request->attributes->get('name');
86

9-
return new Response('Hello ' . $name . '!', 200);
7+
echo "Hello $name!";

tests/_data/routes/doc-examples/hello/[name]/[age].php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
/** @var Symfony\Component\HttpFoundation\Request $request */
44

5-
use Symfony\Component\HttpFoundation\Response;
6-
75
$name = $request->attributes->get('name');
86
$age = $request->attributes->get('age');
97

10-
return new Response("Hello $name! You are $age years old.", 200);
8+
echo "Hello $name! You are $age years old.";

tests/_data/routes/doc-examples/hello/catchall/[...name].php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
/** @var Symfony\Component\HttpFoundation\Request $request */
44

5-
use Symfony\Component\HttpFoundation\Response;
6-
75
$name = $request->attributes->get('name');
86

9-
return new Response("Hello $name!", 200);
7+
echo "Hello $name!";
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
<?php declare(strict_types=1);
22

3-
use Symfony\Component\HttpFoundation\Response;
4-
5-
return new Response("<h1>php-page</h1>", 200);
3+
echo "<h1>php-page</h1>";
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
<?php declare(strict_types=1);
22

3-
use Symfony\Component\HttpFoundation\Response;
4-
53
// Do something with body like saving it to a database
64

7-
return new Response('{"updated": true}', 200, [
8-
'Content-Type' => 'application/json',
9-
]);
5+
return ['updated' => true];
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
<?php declare(strict_types=1);
22

3-
use Symfony\Component\HttpFoundation\Response;
4-
5-
return new Response('<h1>php.get.php</h1>');
3+
return '<h1>php.get.php</h1>';
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
<?php declare(strict_types=1);
22

3-
use Symfony\Component\HttpFoundation\Response;
4-
5-
return new Response('<h1>php.php</h1>');
3+
return '<h1>php.php</h1>';

0 commit comments

Comments
 (0)