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
59
SPDY
natata
0
110
How to trace code
natata
0
49
HTML5 canvas game
natata
0
69
Introduction to HTML5
natata
0
39
Other Decks in Programming
See All in Programming
我々はなぜ「層」を分けるのか〜「関心の分離」と「抽象化」で手に入れる変更に強いシンプルな設計〜 #phperkaigi / PHPerKaigi 2026
shogogg
2
790
The free-lunch guide to idea circularity
hollycummins
0
410
今こそ押さえておきたい アマゾンウェブサービス(AWS)の データベースの基礎 おもクラ #6版
satoshi256kbyte
1
230
RSAが破られる前に知っておきたい 耐量子計算機暗号(PQC)入門 / Intro to PQC: Preparing for the Post-RSA Era
mackey0225
3
120
へんな働き方
yusukebe
6
2.9k
PHPで TLSのプロトコルを実装してみる
higaki_program
0
730
Geminiをパートナーに神社DXシステムを個人開発した話(いなめぐDX 開発振り返り)
fujiba
0
140
GoのDB アクセスにおける 「型安全」と「柔軟性」の両立 - Bob という選択肢
tak848
0
310
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
180
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
1.4k
Radical Imagining - LIFT 2025-2027 Policy Agenda
lift1998
0
230
Vibe하게 만드는 Flutter GenUI App With ADK , 박제창, BWAI Incheon 2026
itsmedreamwalker
0
540
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
28
2.5k
The browser strikes back
jonoalderson
0
890
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.2k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
100
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.1k
Paper Plane
katiecoart
PRO
1
49k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
310
Test your architecture with Archunit
thirion
1
2.2k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
390
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.6k
The Curse of the Amulet
leimatthew05
1
11k
From π to Pie charts
rasagy
0
160
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