Create an application directory file
We create a folder in the Web's root directory (/var/www or elsewhere), named HelloWorld. Unzip the downloaded frame and place it in the application directory. Create a good directory structure as follows:
- /var/www/helloworld/wind/Framework Directory
- controller/Application Controller directory, business code placed in this directory
- controller/indexcontroller.php application controller with default access
- template/page Template Catalog
- template/index.htm template file
- index.php Portal Script File
- Edit Entry Script index.php
Create the portal script index.php in the application directory, its main task is to load the frame and start the application. The code is as follows:
require_once ('.. /.. /wind/wind.php ');
Wind::application()->run();
PS: Of course, you can also set the error level in the index.php, Wind_debug mode and so on. Related content will be described later
Create indexcontroller.php
The
Creates the controller/directory under the application directory. The controller directory is the directory that is stored by the Windframework default-defined application controller, and we can change the access path of the application by manually configuring it. Create the Indexcontroller.php class file under the controller/directory we created. The contents of the file are as follows:
<?php /** * the last known user to change this file in the repository < $L AstChangedBy:long.shi $> * @author Qiong Wu papa0924@gmail.com> * * @package */ class indexcontroller extends Windcontroller { public function run { echo ' Hello World ' } }
The file name and class name are the same in Windframework, which is somewhat similar to Java. Windframework provides two types of application controllers ' Windsimplecontroller ', ' Windcontroller '. Here we inherit from ' Windcontroller ', the difference between the two application controllers, which will be specifically described later.
Run
At this point, our Hello World application has been completed. Quickly visit our Hello world through the browser:
http://localhost/helloworld/index.php