Minor [PHP framework] 2. the first application HelloWorld and minorhello. Minor [PHP framework] 2. the first application, HelloWorld, minorhello2.1HelloWorld2.1.1, configures the route in appConfigroutes. add the following configuration to the PHP file: return [... helloworld Minor [PHP framework] 2. the first application Hello World, minorhello
2.1 Hello World
2.1.1 configure routes
Add the following configuration to the app/Config/routes. php file:
return [ ... '/helloworld' => [ 'name' => 'helloworld', 'controller' => 'App\Modules\Demo\Controller\HelloController', 'action' => 'hello' ],];
After this configuration, when we access the ingress
2.1.2 create a controller
In the app/Modules folder, create a folder: Demo/Controller/, create the file HelloController. php, and write the following in the file:
'World']); }}
2.1.3 create a view file
Create a folder/Tpl/Hello/in the app/Modules/Demo/folder and then create hello. php:
Hello
Then visit http://xxx.xxx.xxx/helloworldin the browser to see Hello World.
Http://www.bkjia.com/PHPjc/1133570.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1133570.htmlTechArticleMinor【 PHP framework] 2. the first application Hello World, minorhello 2.1 Hello World 2.1.1 configures the route in app/Config/routes. add the following configuration to the PHP file: return [... '/helloworld '...