NO.16 简单的Hello world!

安装好框架之后,让我们来用框架来实现helloworld!

更多禅道详情尽在:http://www.zentao.net/

我们以框架代码部署在**/var/www/zentaophp**为例:  

一、创建应用目录:

在框架的目录下面,有一个app目录,在这个app目录下面创建helloworld目录。

$> mkdir helloworld

**二、创建框架的目录结构

**

框架典型的三个目录,config, module, www, 分别存放配置文件,模块文件,以及入口文件、样式表、js文件、图片等。

$> cd helloworld;
$> mkdir config module www

**三、拷贝配置文件

**

框架运行需要一个主配置文件。这个文件从demo应用里面拷贝一个过来即可。

$> cd config;
$> cp ../../demo/config/config.php ./

**四、创建入口文件。

**

框架运行需要一个入口文件,一般我们是将其存为www/index.php。

在www目录下面编辑index.php文件,写入下面的代码

parseRequest(); $app->loadModule(); ### 五、创建index模块 下面我们在module目录创建index模块。 **$> cd module; $> mkdir index;** **[![](http://devel.zentao.net/data/upload/201105/2811405803063b4b.gif)](https://www.oschina.net/action/GoToLink?url=http%3A%2F%2Fdevel.zentao.net%2Fdata%2Fupload%2F201105%2F2811405803063b4b.gif)** ### 六、创建control.php文件。 在index模块下面,编辑control.php,写入下面的代码:

评论

暂无评论