SlideShare a Scribd company logo
PHPTAL Prasad Sep 11, 2009
What is PHPTAL? ,[object Object]
Advantages ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Disadvantages ,[object Object]
<?php include_once 'PHPTAL/PHPTAL.php'; $phptal = new PHPTAL( 'markupfile.html' ); $phptal->set( 'PAGE_TITLE', 'PHPTAL - introduction'); $phptal->set( 'NUMBERS', array(10,20,30,40)); try { echo $phptal->execute(); } catch(Exception $e) { echo $e; } ?> <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;> <html> <head> <title  tal:content=”PAGE_TITLE” ></title> </head> <body> <table> <tr  tal:repeat=”NUMBER NUMBERS” > <td  tal:content=”NUMBER” ></td> </tr> </table> </body> </html>
<!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;> <html> <head> <title> PHPTAL - introduction </title> </head> <body> <table> <tr> <td>10</td> </tr> <tr> <td>20</td> </tr> <tr> <td>30</td> </tr> <tr> <td>40</td> </tr> </table> </body> </html>
<?php include_once 'PHPTAL/PHPTAL.php'; $phptal = new PHPTAL( 'markupfile.html' ); $phptal->set( 'PAGE_TITLE', 'PHPTAL - introduction'); $phptal->set( 'DATAGEN', new MyClass()); try { echo $phptal->execute(); } catch(Exception $e) { echo $e; } ?> <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;> <html> <head> <title  tal:content=”PAGE_TITLE” ></title> </head> <body> <div tal:content=” php: DATAGEN.getContent() ” tal:condition=” php: DATAGEN->checkAccess() ”></div> </body> </html> <?php class MyClass { function checkAccess() { return true; } function getContent() { return “PHPTAL is simple!”; } } ?>
<!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;> <html> <head> <title> PHPTAL - introduction </title> </head> <body> <div>PHPTAL is simple!</div> </body> </html>
<head  metal:define-macro=”headerSection” > <title>PHPTAL - Macro</title> </head> <div  metal:define-macro=”footerSection” > <p>Footer is not unless used.</p> </div> <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;> <html> <head  metal:use-macro=”Macro.html/headerSection” > <title>This will be over-written</title> </head> <body> <p> Head section is included via macro! </p> </body> </html> Macro.html
<!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;> <html> <head> <title> PHPTAL - Macro </title> </head> <body> <p> Head section is included via macro! </p> </body> </html>
<!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;> <html> <head> <title  i18n:translate=”” >PHPTAL</title> </head> <body> <p  i18n:translate=”LBL_BODY_CONTENT” > Placehodler content. </p> </body> </html> ,[object Object],[object Object]

More Related Content

What's hot

PHP Basics for Designers
PHP Basics for DesignersPHP Basics for Designers
PHP Basics for Designers
Matthew Turland
 
Introduction to HAML
Introduction to HAMLIntroduction to HAML
Introduction to HAML
Jon Dean
 
ImplementingChangeTrackingAndFlagging
ImplementingChangeTrackingAndFlaggingImplementingChangeTrackingAndFlagging
ImplementingChangeTrackingAndFlagging
Suite Solutions
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
Niit
 
Debugging and Error handling
Debugging and Error handlingDebugging and Error handling
Debugging and Error handling
Suite Solutions
 
シックス・アパート・フレームワーク
シックス・アパート・フレームワークシックス・アパート・フレームワーク
シックス・アパート・フレームワーク
Takatsugu Shigeta
 
Php(report)
Php(report)Php(report)
Php(report)
Yhannah
 
Php Error Handling
Php Error HandlingPhp Error Handling
Php Error Handling
mussawir20
 

What's hot (20)

PHP Basics for Designers
PHP Basics for DesignersPHP Basics for Designers
PHP Basics for Designers
 
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM
 
Processing XML with Java
Processing XML with JavaProcessing XML with Java
Processing XML with Java
 
Jsp And Jdbc
Jsp And JdbcJsp And Jdbc
Jsp And Jdbc
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
Php exceptions
Php exceptionsPhp exceptions
Php exceptions
 
KMUTNB - Internet Programming 3/7
KMUTNB - Internet Programming 3/7KMUTNB - Internet Programming 3/7
KMUTNB - Internet Programming 3/7
 
Html in a box
Html in a boxHtml in a box
Html in a box
 
Introduction to HAML
Introduction to HAMLIntroduction to HAML
Introduction to HAML
 
Errors, Exceptions & Logging (PHP Hants Oct '13)
Errors, Exceptions & Logging (PHP Hants Oct '13)Errors, Exceptions & Logging (PHP Hants Oct '13)
Errors, Exceptions & Logging (PHP Hants Oct '13)
 
ImplementingChangeTrackingAndFlagging
ImplementingChangeTrackingAndFlaggingImplementingChangeTrackingAndFlagging
ImplementingChangeTrackingAndFlagging
 
Php tutorial
Php tutorialPhp tutorial
Php tutorial
 
Debugging and Error handling
Debugging and Error handlingDebugging and Error handling
Debugging and Error handling
 
PHP NOTES FOR BEGGINERS
PHP NOTES FOR BEGGINERSPHP NOTES FOR BEGGINERS
PHP NOTES FOR BEGGINERS
 
Changing Template Engine
Changing Template EngineChanging Template Engine
Changing Template Engine
 
シックス・アパート・フレームワーク
シックス・アパート・フレームワークシックス・アパート・フレームワーク
シックス・アパート・フレームワーク
 
Evolution of API With Blogging
Evolution of API With BloggingEvolution of API With Blogging
Evolution of API With Blogging
 
The Big Documentation Extravaganza
The Big Documentation ExtravaganzaThe Big Documentation Extravaganza
The Big Documentation Extravaganza
 
Php(report)
Php(report)Php(report)
Php(report)
 
Php Error Handling
Php Error HandlingPhp Error Handling
Php Error Handling
 

Similar to PHPTAL introduction

Система рендеринга в Magento
Система рендеринга в MagentoСистема рендеринга в Magento
Система рендеринга в Magento
Magecom Ukraine
 
Open Source Package Php Mysql 1228203701094763 9
Open Source Package Php Mysql 1228203701094763 9Open Source Package Php Mysql 1228203701094763 9
Open Source Package Php Mysql 1228203701094763 9
isadorta
 
Drupal 7 Theming - what's new
Drupal 7 Theming - what's newDrupal 7 Theming - what's new
Drupal 7 Theming - what's new
Marek Sotak
 
Optimizing Drupal for Mobile Devices
Optimizing Drupal for Mobile DevicesOptimizing Drupal for Mobile Devices
Optimizing Drupal for Mobile Devices
Sugree Phatanapherom
 
1.1 xhtml basics
1.1 xhtml basics1.1 xhtml basics
1.1 xhtml basics
Bulldogs83
 

Similar to PHPTAL introduction (20)

Introduction To Lamp
Introduction To LampIntroduction To Lamp
Introduction To Lamp
 
Система рендеринга в Magento
Система рендеринга в MagentoСистема рендеринга в Magento
Система рендеринга в Magento
 
APEX Themes and Templates
APEX Themes and TemplatesAPEX Themes and Templates
APEX Themes and Templates
 
Developing Gadgets
Developing GadgetsDeveloping Gadgets
Developing Gadgets
 
JWU Guest Talk: JavaScript and AJAX
JWU Guest Talk: JavaScript and AJAXJWU Guest Talk: JavaScript and AJAX
JWU Guest Talk: JavaScript and AJAX
 
Ajaxppt
AjaxpptAjaxppt
Ajaxppt
 
Ajaxppt
AjaxpptAjaxppt
Ajaxppt
 
Html5
Html5Html5
Html5
 
The Basics Of Page Creation
The Basics Of Page CreationThe Basics Of Page Creation
The Basics Of Page Creation
 
Html5 Overview
Html5 OverviewHtml5 Overview
Html5 Overview
 
Open Source Package PHP & MySQL
Open Source Package PHP & MySQLOpen Source Package PHP & MySQL
Open Source Package PHP & MySQL
 
Open Source Package Php Mysql 1228203701094763 9
Open Source Package Php Mysql 1228203701094763 9Open Source Package Php Mysql 1228203701094763 9
Open Source Package Php Mysql 1228203701094763 9
 
Drupal 7 Theming - what's new
Drupal 7 Theming - what's newDrupal 7 Theming - what's new
Drupal 7 Theming - what's new
 
Html ppt
Html pptHtml ppt
Html ppt
 
PHP MySQL
PHP MySQLPHP MySQL
PHP MySQL
 
Control Structures In Php 2
Control Structures In Php 2Control Structures In Php 2
Control Structures In Php 2
 
Java Script
Java ScriptJava Script
Java Script
 
Optimizing Drupal for Mobile Devices
Optimizing Drupal for Mobile DevicesOptimizing Drupal for Mobile Devices
Optimizing Drupal for Mobile Devices
 
1.1 xhtml basics
1.1 xhtml basics1.1 xhtml basics
1.1 xhtml basics
 
Open Power Template 2 presentation
Open Power Template 2 presentationOpen Power Template 2 presentation
Open Power Template 2 presentation
 

Recently uploaded

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Server-Driven User Interface (SDUI) at Priceline
Server-Driven User Interface (SDUI) at PricelineServer-Driven User Interface (SDUI) at Priceline
Server-Driven User Interface (SDUI) at Priceline
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Enterprise Security Monitoring, And Log Management.
Enterprise Security Monitoring, And Log Management.Enterprise Security Monitoring, And Log Management.
Enterprise Security Monitoring, And Log Management.
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Intelligent Gimbal FINAL PAPER Engineering.pdf
Intelligent Gimbal FINAL PAPER Engineering.pdfIntelligent Gimbal FINAL PAPER Engineering.pdf
Intelligent Gimbal FINAL PAPER Engineering.pdf
 
Connecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKConnecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAK
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 

PHPTAL introduction

  • 1. PHPTAL Prasad Sep 11, 2009
  • 2.
  • 3.
  • 4.
  • 5. <?php include_once 'PHPTAL/PHPTAL.php'; $phptal = new PHPTAL( 'markupfile.html' ); $phptal->set( 'PAGE_TITLE', 'PHPTAL - introduction'); $phptal->set( 'NUMBERS', array(10,20,30,40)); try { echo $phptal->execute(); } catch(Exception $e) { echo $e; } ?> <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;> <html> <head> <title tal:content=”PAGE_TITLE” ></title> </head> <body> <table> <tr tal:repeat=”NUMBER NUMBERS” > <td tal:content=”NUMBER” ></td> </tr> </table> </body> </html>
  • 6. <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;> <html> <head> <title> PHPTAL - introduction </title> </head> <body> <table> <tr> <td>10</td> </tr> <tr> <td>20</td> </tr> <tr> <td>30</td> </tr> <tr> <td>40</td> </tr> </table> </body> </html>
  • 7. <?php include_once 'PHPTAL/PHPTAL.php'; $phptal = new PHPTAL( 'markupfile.html' ); $phptal->set( 'PAGE_TITLE', 'PHPTAL - introduction'); $phptal->set( 'DATAGEN', new MyClass()); try { echo $phptal->execute(); } catch(Exception $e) { echo $e; } ?> <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;> <html> <head> <title tal:content=”PAGE_TITLE” ></title> </head> <body> <div tal:content=” php: DATAGEN.getContent() ” tal:condition=” php: DATAGEN->checkAccess() ”></div> </body> </html> <?php class MyClass { function checkAccess() { return true; } function getContent() { return “PHPTAL is simple!”; } } ?>
  • 8. <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;> <html> <head> <title> PHPTAL - introduction </title> </head> <body> <div>PHPTAL is simple!</div> </body> </html>
  • 9. <head metal:define-macro=”headerSection” > <title>PHPTAL - Macro</title> </head> <div metal:define-macro=”footerSection” > <p>Footer is not unless used.</p> </div> <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;> <html> <head metal:use-macro=”Macro.html/headerSection” > <title>This will be over-written</title> </head> <body> <p> Head section is included via macro! </p> </body> </html> Macro.html
  • 10. <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;> <html> <head> <title> PHPTAL - Macro </title> </head> <body> <p> Head section is included via macro! </p> </body> </html>
  • 11.