php skymvc 一款轻量、简单的php

2019-04-09 03:53:09王旭


<?php
class helloModel
{
public
$base;
function
__construct(&$base)
{
$this->helloModel($base);
}

function
helloModel(&$base)
{
$this->base=$base;
$this->db=$base->$db;
}
//上面都是不用改的
function gettest(){
return $this->db->getRow("select * from test
limit 1");//读取数据
}
}
?>

在tpl目录下 新建 hello.html

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=gb2312"
/>
<title>无标题文档</title>
</head>
<body>
这是第一个例子:Hello World !
这是测试的例子:{loop $test $t} {$t}
{/loop}
</body>
</html>

skymvc 下载地址
相关文章 大家在看