123456789101112131415161718192021222324252627 |
- <?php
- declare(strict_types=1);
- namespace App\Controller;
- use Hyperf\HttpServer\Annotation\Controller;
- use Hyperf\HttpServer\Annotation\GetMapping;
- use Hyperf\View\RenderInterface;
- #[Controller(prefix: "/demo")]
- class DemoController
- {
- #[GetMapping(path: "smarty")]
- public function smartyDemo(RenderInterface $render)
- {
- return $render->render('demo', [
- 'title' => 'Hyperf + Smarty 演示',
- 'now' => time(),
- 'show_extra' => true,
- 'items' => [
- '框架' => 'Hyperf ' . hyperf_version(),
- 'PHP版本' => PHP_VERSION,
- '模板引擎' => 'Smarty ' . \Smarty::SMARTY_VERSION,
- ],
- ]);
- }
- }
|