add 'adding content' chapter

This commit is contained in:
lubiana 2022-04-05 19:09:40 +02:00
parent fed49011bd
commit 10aa69d6d4
Signed by: lubiana
SSH key fingerprint: SHA256:vW1EA0fRR3Fw+dD/sM0K+x3Il2gSry6YRYHqOeQwrfk
20 changed files with 884 additions and 251 deletions

View file

@ -2,18 +2,15 @@
namespace Lubian\NoFramework\Action;
use Lubian\NoFramework\Template\MarkdownParser;
use Psr\Http\Message\ResponseInterface;
final class Other
{
public function someFunctionName(ResponseInterface $response): ResponseInterface
public function someFunctionName(ResponseInterface $response, MarkdownParser $parser): ResponseInterface
{
$body = $response->getBody();
$body->write('This works too!');
return $response
->withStatus(200)
->withBody($body);
$html = $parser->parse('This *works* **too!**');
$response->getBody()->write($html);
return $response->withStatus(200);
}
}