Skip to main content

Congratulations!

You have just learned the basics of Docusaurus and made some changes to the initial template.

Docusaurus has much more to offer!

Have 5 more minutes? Take a look at versioning and i18n.

Anything unclear or buggy in this tutorial? Please report it!

What's next?

<?php 
declare(strict_types=1);

namespace App\Http\Controller;

use Swoft;
use Swoft\Http\Message\ContentType;
use Swoft\Http\Message\Response;
use Swoft\Http\Server\Annotation\Mapping\Controller;
use Swoft\Http\Server\Annotation\Mapping\RequestMapping;
use Swoft\View\Renderer;
use Throwable;
use function context;

/**
* Class HomeController
* @Controller()
*/
class HomeController
{
/**
* @RequestMapping("/")
* @throws Throwable
*/
public function index(): Response
{
/** @var Renderer $renderer */
$renderer = Swoft::getBean('view');
$content = $renderer->render('home/index');

return context()->getResponse()->withContentType(ContentType::HTML)->withContent($content);
}

}
?>
console.log('Every repo must come with a mascot.');