300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > 功能最强大的php框架 【精粹】架构合理+强大的PHP框架再次推荐 傲视群雄~

功能最强大的php框架 【精粹】架构合理+强大的PHP框架再次推荐 傲视群雄~

时间:2019-03-25 02:42:09

相关推荐

功能最强大的php框架 【精粹】架构合理+强大的PHP框架再次推荐 傲视群雄~

PHP code<?php

class IndexAction extends YouYaX

{

//伪静态设置.html,注意这里配置了,下面全都要加上.html

public function lizi1()

{

header("Content-type: text/html; charset=utf-8");

$this->display("lizi1.html");

}

//获取配置项

public function getC(){

$this->assign('cdata',C('static_url'));

$this->display('c.html');

}

//跳转方法

public function jump(){

$this->redirect("Index/lizi1.html");

}

//增加数据,常规操作

public function adddata(){

$data['title']='ChangShu';

$this->add($data,"demo");

$this->redirect("Index/lizi1.html");

}

//更新数据

public function savedata(){

$data['title']='ChangShu2';

$this->save($data,"demo",1);

$this->redirect("Index/lizi1.html");

}

//查找单条数据集

public function finddata(){

$data=$this->find("demo","string",1);

$this->assign('data',$data);

$this->display('find.html');

}

//查找数据集合

public function seldata(){

$data=$this->select("select * from demo where id between 1 and 3");

$this->assign('data',$data);

$this->display('sel.html');

}

//删除数据,略

//数据表实例化操作

public function tadd(){

$u=T("demo");

$u->title='nantong';

$u->add();

$this->redirect("Index/lizi1.html");

}

//实例化更新数据

public function tsave(){

$u=T("demo");

$u2=$u->find(1);

$u2->title='SUZHOU';

$u2->save();

$this->redirect("Index/lizi1.html");

}

//查找数据集,,集合等等,省略,,参阅中文手册

//多语言,要修改lng/lang.php

public function lang(){

$this->display('lang.html');

}

//验证方法,要修改Model/Model.php

public function vali(){

$data='';

//$data="hell";

if(match($data,"title")){

$this->redirect("Index/lizi1.html");

}

}

//二维数组调用函数,使用common/common.php

public function common(){

$u=T("demo");

$data=$u->select("1,2,3");

$this->assign('data',$data);

$this->display("common.html");

}

//大型复杂项目循环数组运算使用,注意$this->array_array $this->array_two的用法

public function dophp(){

$data=$this->select("select * from demo");

$this->assign('data',$data);

$this->display('fuza.html');

}

}

?>

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。