php5与mysql5 web 开发技术详解-12 Smarty与模板技术
1、MVC简介
模式的内部运行着系统核心的商业逻辑;
视图处理系统的格式化输出;
控制器处理输入和与控制器进行通信
2、常用模板系统
Smarty \ FastTemplate\Smart
....
3、Smarty概述
优点和开发特性....
4、Smarty安装和配置
5、Smrty开发基础
变量与变量格式化:
变量来源:
首字母大写:{ $title| capitalize}?>
计算字符个数:{ $title| count_words}?>
日期处理:{ $filed| "$B %e, %y"}?> { $Smarty.now | date_format: "%Y-%m-%d %H:%M:%S"}
过滤字符:{ $title| strip_tags}?>
截取字串:{ $title|trancate:20:"..." | false }?>
nl2br修饰符:{ $text | nl2br}?>
6、控制结构
分支:if elseif else /if
比较运算符: eq (= ), neq(!=) ,gte(>=) ,not (
循环结构:
foreach
section
7、缓存
8、深入开发
register_function
register_block
register_modifier
{php}?>{/php}?>
重要修饰符:
default
strip_tags
literal
nl2br
truncate
生成静态页:www.2cto.com
$output = $smarty->fetch('tmp.html');
fwrite($fp ,$output );

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

Atom editor mac version download
The most popular open source editor

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver CS6
Visual web development tools