SlideShare a Scribd company logo
PHPTAL with CakePHP
       July 2011
           CakePHP
About Me


•   WEB Developer / PHP / CakePHP / HTML / CSS / jQuery / MySQL / iPhone /
    /     /    /     /      /             /          / no more

•   BLOG: http://php-tips.com/
•   TWITTER: @nojimage
Template Engine
Template Engine

•                                     HTML


• Smarty, Twig, PHP, PHPTAL, etc...
Data               Template




       Template
        Engine




        HTML,
       RSS Feed,
         etc...
PHPTAL
TAL

•                            XHTML(XML)


• http://wiki.zope.org/ZPT/TAL
Templae Attribute Language

•                            XHTML(XML)


• http://wiki.zope.org/ZPT/TAL
PHPTAL

• Zope      TAL    PHP

•

    http://phptal.org/
•

    http://phptal.org/manual/ja/
code
Data
$people = array(
    array(
        ‘name’ => ‘Taro Yamada’,
        ‘phone’ => ‘090-0000-0000’
    ),
    array(
        ‘name’ => ‘Hisateru Tanaka’,
        ‘phone’ => ’06-XXXX-XXXX’
    ),
    // ...
);
HTML
<table>
    <tr>
         <th>Name</th>
         <th>Phone</th>
    </tr>
    <tr>
         <td>person's name</td>
         <td>person's phone</td>
    </tr>
    <tr>
         <td>sample name</td>
         <td>sample phone</td>
    </tr>
</table>
<table>
    <tr>
         <th>Name</th>
         <th>Phone</th>
    </tr>
    <tr>
         <td>person's name</td>
         <td>person's phone</td>
    </tr>
    <tr>
         <td>sample name</td>
         <td>sample phone</td>
    </tr>
</table>
PHP
<table>
    <tr>
         <th>Name</th>
         <th>Phone</th>
    </tr>
    <?php foreach ($people as $person) : ?>
    <tr>
         <td><?php echo $person['name']; ?></td>
         <td><?php echo $person['phone']; ?></td>
    </tr>
    <?php endforeach; ?>
</table>
Smarty
   is not smart...
<table>
    <tr>
         <th>Name</th>
         <th>Phone</th>
    </tr>
    {foreach from=$people item=person}
    <tr>
         <td>{$person.name}</td>
         <td>{$person.phone}</td>
    </tr>
    {/foreach}
</table>
PHPTAL
<table>
    <tr>
         <th>Name</th>
         <th>Phone</th>
    </tr>
    <tr tal:repeat="person people">
         <td tal:content="person/name">person's
name</td>
         <td tal:content="person/phone">person's
phone</td>
    </tr>
    <tr tal:replace="">
         <td>sample name</td>
         <td>sample phone</td>
    </tr>
</table>
<table>
    <tr>
         <th>Name</th>
         <th>Phone</th>
    </tr>
    <tr tal:repeat="person people">
         <td tal:content="person/name">person's

   HTML
name</td>
         <td tal:content="person/phone">person's
phone</td>
    </tr>
    <tr tal:replace="">
         <td>sample name</td>
         <td>sample phone</td>
    </tr>
</table>
in Browser
in Browser
in Browser
in Browser




HTML
HTML
PHPTAL

•

    1. tal:define          7. tal:attributes
    2. tal:condition      8. tal:on-error
    3. tal:repeat         9. metal:define-macro
    4. tal:omit-tag       10. metal:use-macro
    5. tal:replace        11. metal:define-slot
    6. tal:content        12. metal:fill-slot
PHPTAL is Smart!
PHPTAL
PHPTAL
  with
CakePHP
CakePHP-TALTAL
     plugin
https://github.com/nojimage/
     CakePHP-TALTAL
Feature
•       html, xhtml, zpt
    PHPTAL
•       ctp     PHP
      OK
•
Feature
• url,   fullurl
• cake:helper
Installation
• git   clone or download
• set   to plugins/taltal
• write   to AppController
class AppController extends Controller {
    // ...(snip)

    public $view = 'Taltal.Phptal';
    // ...(snip)
}
Let’s Try PHPTAL!!

      PHPTAL
CakePHP-TALTAL
• https://github.com/nojimage/CakePHP-TALTAL

• since   2011/06/01
• version   0.3.1
PHPTAL with CakePHP
PHPTAL with CakePHP

More Related Content

What's hot

Teri's Resume
Teri's ResumeTeri's Resume
Teri's Resumeteri louk
 
Can WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.noCan WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.no
Morten Rand-Hendriksen
 
Secure your folder with password/without any software
Secure your folder with password/without any softwareSecure your folder with password/without any software
Secure your folder with password/without any software
Mohd Sajjad
 
Using MySQL in a web-scale environment
Using MySQL in a web-scale environmentUsing MySQL in a web-scale environment
Using MySQL in a web-scale environment
David Landgren
 
Xslate sv perl-2013-7-11
Xslate sv perl-2013-7-11Xslate sv perl-2013-7-11
Xslate sv perl-2013-7-11Goro Fuji
 
HTML Templates Using Clear Silver
HTML Templates Using Clear SilverHTML Templates Using Clear Silver
HTML Templates Using Clear Silver
PaulWay
 
Popstat1 sh
Popstat1 shPopstat1 sh
Popstat1 sh
Ben Pope
 
PHP Filing
PHP Filing PHP Filing
PHP Filing
Nisa Soomro
 

What's hot (8)

Teri's Resume
Teri's ResumeTeri's Resume
Teri's Resume
 
Can WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.noCan WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.no
 
Secure your folder with password/without any software
Secure your folder with password/without any softwareSecure your folder with password/without any software
Secure your folder with password/without any software
 
Using MySQL in a web-scale environment
Using MySQL in a web-scale environmentUsing MySQL in a web-scale environment
Using MySQL in a web-scale environment
 
Xslate sv perl-2013-7-11
Xslate sv perl-2013-7-11Xslate sv perl-2013-7-11
Xslate sv perl-2013-7-11
 
HTML Templates Using Clear Silver
HTML Templates Using Clear SilverHTML Templates Using Clear Silver
HTML Templates Using Clear Silver
 
Popstat1 sh
Popstat1 shPopstat1 sh
Popstat1 sh
 
PHP Filing
PHP Filing PHP Filing
PHP Filing
 

Viewers also liked

Cake php4designers
Cake php4designersCake php4designers
Cake php4designers
Seiji Ogawa
 
MVCのVを極めしWebデザイナーになる - CakePHP勉強会
MVCのVを極めしWebデザイナーになる - CakePHP勉強会MVCのVを極めしWebデザイナーになる - CakePHP勉強会
MVCのVを極めしWebデザイナーになる - CakePHP勉強会
Kazuhiro Hara
 
アプリケーション性能管理(APM)ツールの新世代 「AppDynamics」のご紹介 – OpenStack最新情報セミナー 2015年7月
アプリケーション性能管理(APM)ツールの新世代 「AppDynamics」のご紹介 – OpenStack最新情報セミナー 2015年7月アプリケーション性能管理(APM)ツールの新世代 「AppDynamics」のご紹介 – OpenStack最新情報セミナー 2015年7月
アプリケーション性能管理(APM)ツールの新世代 「AppDynamics」のご紹介 – OpenStack最新情報セミナー 2015年7月
VirtualTech Japan Inc.
 
App Dynamics case study on U-NEXT at AppJam 2015 in TOKYO
App Dynamics case study on U-NEXT at AppJam 2015 in TOKYOApp Dynamics case study on U-NEXT at AppJam 2015 in TOKYO
App Dynamics case study on U-NEXT at AppJam 2015 in TOKYO
Takatoshi Kakimoto
 
安全なPHPアプリケーションの作り方2016
安全なPHPアプリケーションの作り方2016安全なPHPアプリケーションの作り方2016
安全なPHPアプリケーションの作り方2016
Hiroshi Tokumaru
 
PHPの今とこれから2016
PHPの今とこれから2016PHPの今とこれから2016
PHPの今とこれから2016
Rui Hirokawa
 
PHP AST 徹底解説
PHP AST 徹底解説PHP AST 徹底解説
PHP AST 徹底解説
do_aki
 

Viewers also liked (7)

Cake php4designers
Cake php4designersCake php4designers
Cake php4designers
 
MVCのVを極めしWebデザイナーになる - CakePHP勉強会
MVCのVを極めしWebデザイナーになる - CakePHP勉強会MVCのVを極めしWebデザイナーになる - CakePHP勉強会
MVCのVを極めしWebデザイナーになる - CakePHP勉強会
 
アプリケーション性能管理(APM)ツールの新世代 「AppDynamics」のご紹介 – OpenStack最新情報セミナー 2015年7月
アプリケーション性能管理(APM)ツールの新世代 「AppDynamics」のご紹介 – OpenStack最新情報セミナー 2015年7月アプリケーション性能管理(APM)ツールの新世代 「AppDynamics」のご紹介 – OpenStack最新情報セミナー 2015年7月
アプリケーション性能管理(APM)ツールの新世代 「AppDynamics」のご紹介 – OpenStack最新情報セミナー 2015年7月
 
App Dynamics case study on U-NEXT at AppJam 2015 in TOKYO
App Dynamics case study on U-NEXT at AppJam 2015 in TOKYOApp Dynamics case study on U-NEXT at AppJam 2015 in TOKYO
App Dynamics case study on U-NEXT at AppJam 2015 in TOKYO
 
安全なPHPアプリケーションの作り方2016
安全なPHPアプリケーションの作り方2016安全なPHPアプリケーションの作り方2016
安全なPHPアプリケーションの作り方2016
 
PHPの今とこれから2016
PHPの今とこれから2016PHPの今とこれから2016
PHPの今とこれから2016
 
PHP AST 徹底解説
PHP AST 徹底解説PHP AST 徹底解説
PHP AST 徹底解説
 

Similar to PHPTAL with CakePHP

Xml and xslt
Xml and xsltXml and xslt
Xml and xslt
SadahAnjumShanto
 
XML and Web Services with PHP5 and PEAR
XML and Web Services with PHP5 and PEARXML and Web Services with PHP5 and PEAR
XML and Web Services with PHP5 and PEAR
Stephan Schmidt
 
XML Transformations With PHP
XML Transformations With PHPXML Transformations With PHP
XML Transformations With PHP
Stephan Schmidt
 
APEX Themes and Templates
APEX Themes and TemplatesAPEX Themes and Templates
APEX Themes and Templates
InSync Conference
 
Introduction To Xml
Introduction To XmlIntroduction To Xml
Introduction To Xml
bdebruin
 
Forum Presentation
Forum PresentationForum Presentation
Forum Presentation
Angus Pratt
 
Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8Tatsuhiko Miyagawa
 
Inroduction to XSLT with PHP4
Inroduction to XSLT with PHP4Inroduction to XSLT with PHP4
Inroduction to XSLT with PHP4
Stephan Schmidt
 
Html5 Overview
Html5 OverviewHtml5 Overview
Html5 Overview
Owen Williams
 
Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)
Michiel Rook
 
13. view data
13. view data13. view data
13. view data
Razvan Raducanu, PhD
 
PHP Presentation
PHP PresentationPHP Presentation
PHP PresentationNikhil Jain
 
Changing Template Engine
Changing Template EngineChanging Template Engine
Changing Template Engine
Takatsugu Shigeta
 
BITM3730 9-13.pptx
BITM3730 9-13.pptxBITM3730 9-13.pptx
BITM3730 9-13.pptx
MattMarino13
 
REST, HTTP, and the PATCH verb (with kittens)
REST, HTTP, and the PATCH verb (with kittens)REST, HTTP, and the PATCH verb (with kittens)
REST, HTTP, and the PATCH verb (with kittens)
almostobsolete
 
REST dojo Comet
REST dojo CometREST dojo Comet
REST dojo Comet
Carol McDonald
 
20120424 b
20120424 b20120424 b
20120424 b
slidesharepimp
 
PHPTAL introduction
PHPTAL introductionPHPTAL introduction
PHPTAL introduction
'"">
 

Similar to PHPTAL with CakePHP (20)

Xml and xslt
Xml and xsltXml and xslt
Xml and xslt
 
XML and Web Services with PHP5 and PEAR
XML and Web Services with PHP5 and PEARXML and Web Services with PHP5 and PEAR
XML and Web Services with PHP5 and PEAR
 
XML Transformations With PHP
XML Transformations With PHPXML Transformations With PHP
XML Transformations With PHP
 
APEX Themes and Templates
APEX Themes and TemplatesAPEX Themes and Templates
APEX Themes and Templates
 
Introduction To Xml
Introduction To XmlIntroduction To Xml
Introduction To Xml
 
Forum Presentation
Forum PresentationForum Presentation
Forum Presentation
 
Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8
 
Inroduction to XSLT with PHP4
Inroduction to XSLT with PHP4Inroduction to XSLT with PHP4
Inroduction to XSLT with PHP4
 
Html5 Overview
Html5 OverviewHtml5 Overview
Html5 Overview
 
Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)
 
13. view data
13. view data13. view data
13. view data
 
PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
 
Changing Template Engine
Changing Template EngineChanging Template Engine
Changing Template Engine
 
BITM3730 9-13.pptx
BITM3730 9-13.pptxBITM3730 9-13.pptx
BITM3730 9-13.pptx
 
REST, HTTP, and the PATCH verb (with kittens)
REST, HTTP, and the PATCH verb (with kittens)REST, HTTP, and the PATCH verb (with kittens)
REST, HTTP, and the PATCH verb (with kittens)
 
REST dojo Comet
REST dojo CometREST dojo Comet
REST dojo Comet
 
Tornado
TornadoTornado
Tornado
 
20120424 b
20120424 b20120424 b
20120424 b
 
Lab final
Lab finalLab final
Lab final
 
PHPTAL introduction
PHPTAL introductionPHPTAL introduction
PHPTAL introduction
 

More from Takashi Nojima

Composerはじめました
ComposerはじめましたComposerはじめました
Composerはじめました
Takashi Nojima
 
Plugin for CakePHP2.0
Plugin for CakePHP2.0Plugin for CakePHP2.0
Plugin for CakePHP2.0
Takashi Nojima
 
jQuery プラグイン作成入門
jQuery プラグイン作成入門jQuery プラグイン作成入門
jQuery プラグイン作成入門
Takashi Nojima
 
CakePHP SessionAcl Component
CakePHP SessionAcl ComponentCakePHP SessionAcl Component
CakePHP SessionAcl Component
Takashi Nojima
 
Mixi kit
Mixi kitMixi kit
Mixi kit
Takashi Nojima
 
TwitterKitではじめる OAuthスピードクッキング
TwitterKitではじめる OAuthスピードクッキングTwitterKitではじめる OAuthスピードクッキング
TwitterKitではじめる OAuthスピードクッキング
Takashi Nojima
 

More from Takashi Nojima (6)

Composerはじめました
ComposerはじめましたComposerはじめました
Composerはじめました
 
Plugin for CakePHP2.0
Plugin for CakePHP2.0Plugin for CakePHP2.0
Plugin for CakePHP2.0
 
jQuery プラグイン作成入門
jQuery プラグイン作成入門jQuery プラグイン作成入門
jQuery プラグイン作成入門
 
CakePHP SessionAcl Component
CakePHP SessionAcl ComponentCakePHP SessionAcl Component
CakePHP SessionAcl Component
 
Mixi kit
Mixi kitMixi kit
Mixi kit
 
TwitterKitではじめる OAuthスピードクッキング
TwitterKitではじめる OAuthスピードクッキングTwitterKitではじめる OAuthスピードクッキング
TwitterKitではじめる OAuthスピードクッキング
 

Recently uploaded

Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
ViralQR
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 

Recently uploaded (20)

Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 

PHPTAL with CakePHP

  • 1. PHPTAL with CakePHP July 2011 CakePHP
  • 2. About Me • WEB Developer / PHP / CakePHP / HTML / CSS / jQuery / MySQL / iPhone / / / / / / / / no more • BLOG: http://php-tips.com/ • TWITTER: @nojimage
  • 4. Template Engine • HTML • Smarty, Twig, PHP, PHPTAL, etc...
  • 5. Data Template Template Engine HTML, RSS Feed, etc...
  • 7. TAL • XHTML(XML) • http://wiki.zope.org/ZPT/TAL
  • 8. Templae Attribute Language • XHTML(XML) • http://wiki.zope.org/ZPT/TAL
  • 9. PHPTAL • Zope TAL PHP • http://phptal.org/ • http://phptal.org/manual/ja/
  • 10. code
  • 11.
  • 12. Data
  • 13. $people = array( array( ‘name’ => ‘Taro Yamada’, ‘phone’ => ‘090-0000-0000’ ), array( ‘name’ => ‘Hisateru Tanaka’, ‘phone’ => ’06-XXXX-XXXX’ ), // ... );
  • 14. HTML
  • 15. <table> <tr> <th>Name</th> <th>Phone</th> </tr> <tr> <td>person's name</td> <td>person's phone</td> </tr> <tr> <td>sample name</td> <td>sample phone</td> </tr> </table>
  • 16. <table> <tr> <th>Name</th> <th>Phone</th> </tr> <tr> <td>person's name</td> <td>person's phone</td> </tr> <tr> <td>sample name</td> <td>sample phone</td> </tr> </table>
  • 17. PHP
  • 18. <table> <tr> <th>Name</th> <th>Phone</th> </tr> <?php foreach ($people as $person) : ?> <tr> <td><?php echo $person['name']; ?></td> <td><?php echo $person['phone']; ?></td> </tr> <?php endforeach; ?> </table>
  • 19. Smarty is not smart...
  • 20. <table> <tr> <th>Name</th> <th>Phone</th> </tr> {foreach from=$people item=person} <tr> <td>{$person.name}</td> <td>{$person.phone}</td> </tr> {/foreach} </table>
  • 22. <table> <tr> <th>Name</th> <th>Phone</th> </tr> <tr tal:repeat="person people"> <td tal:content="person/name">person's name</td> <td tal:content="person/phone">person's phone</td> </tr> <tr tal:replace=""> <td>sample name</td> <td>sample phone</td> </tr> </table>
  • 23. <table> <tr> <th>Name</th> <th>Phone</th> </tr> <tr tal:repeat="person people"> <td tal:content="person/name">person's HTML name</td> <td tal:content="person/phone">person's phone</td> </tr> <tr tal:replace=""> <td>sample name</td> <td>sample phone</td> </tr> </table>
  • 28. HTML
  • 29.
  • 30. PHPTAL • 1. tal:define 7. tal:attributes 2. tal:condition 8. tal:on-error 3. tal:repeat 9. metal:define-macro 4. tal:omit-tag 10. metal:use-macro 5. tal:replace 11. metal:define-slot 6. tal:content 12. metal:fill-slot
  • 32.
  • 34.
  • 35.
  • 37. CakePHP-TALTAL plugin
  • 39. Feature • html, xhtml, zpt PHPTAL • ctp PHP OK •
  • 40. Feature • url, fullurl • cake:helper
  • 41. Installation • git clone or download • set to plugins/taltal • write to AppController class AppController extends Controller { // ...(snip) public $view = 'Taltal.Phptal'; // ...(snip) }