个人web框架php
==========================================================css
前端:css(bootstrap,本身的代码片断),js(jquery,本身的代码片断),html,交互设计。html
1 <?php 2 3 //建立smarty对象 4 require_once './libs/Smarty.class.php'; 5 6 $smarty = new Smarty;//创建smarty实例对象$smarty 7 $smarty -> caching = false;//是否使用缓存 8 $smarty -> template_dir = "./templates";//设置模板目录 9 $smarty -> compile_dir = "./templates_c";//设置编译目录 10 $smarty -> cache_dir = "./smarty_cache";//缓存文件夹 11 //修改左右边界符号 12 $smarty -> left_delimiter="<{"; 13 $smarty -> right_delimiter="}>"; 14 15 $smarty -> assign("var1","hello world");// 16 $smarty -> display("hello.tpl");// 17 18 ?>
smarty模板操做变量:前端
http://www.cnblogs.com/snowinmay/p/3170092.htmlmysql
smarty模板的内置函数:jquery
1 建立数据库: 2 create database books; 3 建立用户: 4 mysql> grant select,insert,delete,uptate 5 -> on books.* 6 -> to dada identified by 'yujianqi2011'; 7 8 使用数据库: 9 use dbname; 10 use dada; 11 12 新建数据库表 13 create table tablename(columns); 14 create table demo( 15 userid int unsigned not null auto_increment primary key, 16 username char(50) not null, 17 password char(20) not null, 18 age int not null, 19 city char(20) not null 20 ); 21 22 显示数据库表 23 show tables; 24 25 在数据库中插入数据 26 insert into demo values(NULL,"dada","yujianqi2011",27,"beijing"); 27 insert into demo values(NULL,"xiaoyin","yujianqi2011",26,"shanghai"); 28 29 查询数据 30 select name, city from customers where name="dada"; 31 32 更新数据 33 update customers 34 set address = "北京市海淀区"; 35 36 删除数据 37 delete from dada where name = "dada"; 38 39 表的删除 40 DROP TABLE table; 41 42 数据删除 43 DROP DATABASE database;