欢迎各位兄弟 发布技术文章
这里的技术是共享的
控制器,里添加数据库操作吗 ?
<?php
// 本类由系统自动生成,仅供测试用途
class IndexAction extends Action {
public function index(){
echo "Hello,World";
$this->show('<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style="padding: 24px 48px;"> <h1>:)</h1><p>欢迎使用 <b>ThinkPHP</b>!</p></div><script type="text/javascript" src="http://tajs.qq.com/stats?sId=9347272"; charset="UTF-8"></script>','utf-8');
}
}
控制器,里添加数据库操作吗 ?
<?php
// 本类由系统自动生成,仅供测试用途
class IndexAction extends Action {
public function index(){
echo "Hello,World";
$this->show('<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style="padding: 24px 48px;"> <h1>:)</h1><p>欢迎使用 <b>ThinkPHP</b>!</p></div><script type="text/javascript" src="http://tajs.qq.com/stats?sId=9347272"; charset="UTF-8"></script>','utf-8');
}
}
$Data=M('表名'); //这里的Data可以随便起,但是必须跟html里面volist的name属性一致
$this->data=$Data->select();
//$this->name='langxianmeng';
$this->display();
<html>
<head>
<title>Select Data</title>
</head>
<body>
<volist name="data" id="vo"><!--name是前面设置的变量名-->
{$vo.org_id}--{$vo.org_name}<br/>
</volist>
$Data=M('表名'); //这里的Data可以随便起,但是必须跟html里面volist的name属性一致
$this->data=$Data->select();
//$this->name='langxianmeng';
$this->display();
<html>
<head>
<title>Select Data</title>
</head>
<body>
<volist name="data" id="vo"><!--name是前面设置的变量名-->
{$vo.org_id}--{$vo.org_name}<br/>
</volist>
aaa
aaa
<volist id="vo" name="dat" >
{$vo.id}
--
{$vo.data}<br/>
</volist>
class IndexAction extends Action {
public function index(){
$Data = M('Data'); // 实例化Data数据模型
echo "1--------------------------------";
$blog = $Data->find(3);
dump($blog);
echo "2-------------------------------";
$this->data = $Data->select();
dump($this->data);;
echo "3-------------------------------";
dump($this);
echo "4-------------------------------";
$this->display();
}
}
<html>
<head>
<title>Select Data</title>
</head>
<body>
<volist name="data" id="id">
{$id.id}**{$id.data}<br/>
</volist>
</body>
</html>
<volist id="vo" name="dat" >
{$vo.id}
--
{$vo.data}<br/>
</volist>
class IndexAction extends Action {
public function index(){
$Data = M('Data'); // 实例化Data数据模型
echo "1--------------------------------";
$blog = $Data->find(3);
dump($blog);
echo "2-------------------------------";
$this->data = $Data->select();
dump($this->data);;
echo "3-------------------------------";
dump($this);
echo "4-------------------------------";
$this->display();
}
}
<html>
<head>
<title>Select Data</title>
</head>
<body>
<volist name="data" id="id">
{$id.id}**{$id.data}<br/>
</volist>
</body>
</html>
exit;
<html><head><title>Select Data</title></head><body></body></html>
<html><head><title>Select Data</title></head><body></body></html>
App::run();
App::run();
App::run();
App::run();
App::run();
App::run();
App::run();
App::run();
App::run();
App::run();
App::run();
App::run();
App::run();
<?php
require '/ThinkPHP框架所在目录/ThinkPHP.php';
<?php
require '/ThinkPHP框架所在目录/ThinkPHP.php';
<?php
require '/ThinkPHP框架所在目录/ThinkPHP.php';