Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
PHP with Smarty
Search
HakumaNatata
October 20, 2009
Programming
35
0
Share
PHP with Smarty
使用 Smarty 分開邏輯與版面
HakumaNatata
October 20, 2009
More Decks by HakumaNatata
See All by HakumaNatata
Introduction to NMAP
natata
0
60
SPDY
natata
0
110
How to trace code
natata
0
50
HTML5 canvas game
natata
0
70
Introduction to HTML5
natata
0
40
Other Decks in Programming
See All in Programming
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
530
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
170
The Arts and Crafts of Work in the AI Era — Toward Mastery in Software Development
kuranuki
1
710
次世代リンターで探る、tsgo 時代における型認識カスタムルールの現実解
ytakahashii
3
1.4k
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
3
860
Modding RubyKaigi for Myself
yui_knk
0
880
AI駆動開発勉強会 広島支部 第一回勉強会 AI駆動開発概要とワークショップ
hayatoshimiu
0
430
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
1.8k
These Five Tricks Can Make Your Apps Greener, Cheaper, & Nicer
hollycummins
0
270
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
340
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
270
Signal Forms: Beyond the Basics @ngBaguette 2026 in Paris
manfredsteyer
PRO
0
220
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
141
7.5k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
590
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
370
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.3k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
160
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.3k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
360
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1.6k
Transcript
資工二A 彭博涵
php http://www.study-area.org/coobila/ tutorial_502.html Hypertext Preprocessor 網頁程式的開發及能夠嵌入HTML文件之 中
當php遇上html 你中有我,我中有你 纏綿圖
糾纏不清的後果 少數人寫網頁 save 網頁開發團隊 dangerous!!
為了維護愛與和平 Smarty出現了
什麼是smarty? Wiki: smarty is a web template system written
in PHP. Smarty is primarily promoted as a tool for separation of concerns, which is a common design strategy for certain kinds of application
http://www.jaceju.net/blog/?cat=8&paged=2
安裝smarty函式庫 http://www.smarty.net/download.php 所需要的:libs 資料夾內的所有檔案 引入:require_once(‘資料夾路徑/ Smarty.class.php');
資料夾的規劃 Project template image .php template_c Lib CSS
第一個smarty化的網頁 demo
連續資料的處理 <{section name=i loop=$array}> <{$array[i]}> <{/section}>
demo1
一維陣列索引不為整數時 <{array.indexName}> demo2
二維陣列 <{section name=i loop=$array}> <{$array[i].indexName}> <{/section}>
精簡化 demo3
修飾變數 demo4
百家爭鳴 24個PHP樣板引擎 http://qa567.pixnet.net/blog/post/25365471
PHP說:我也是樣板引擎!
Smarty 官方網站 http://www.smarty.net/ 網站製作學習誌 http://www.jaceju.net/blog/?p=23
神魂顛倒資訊論壇 http://bbs.flash2u.com.tw/ dispbbs_54_66103.html