【精粹】架构合理+强大的PHP框架再次推荐,傲视群雄~
【精华】架构合理+强大的PHP框架再次推荐,傲视群雄~~~~
示例展示
- PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><?phpclass 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'); }}?>
————————————————————————————————————————————————
lizi1.html 伪静态的配置
- HTML code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><include file="Tpl/top.html"><include file="Tpl/menu.html"> 这是一个伪静态示例,具体实现参考代码。。<include file="Tpl/foot.html"> </include></include></include>
在conf/config.php中设置 'static_url'=>'.html',
—————————————————————————————————————————————————
c.html 获取配置项
- HTML code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><include file="Tpl/top.html"><include file="Tpl/menu.html">输出值为:{cdata}<include file="Tpl/foot.html"></include></include></include>
其中 {cdata} 输出模板变量
————————————————————————————————————————————————

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.
