SlideShare uma empresa Scribd logo
1 de 11
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]

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Semelhante a 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
 

Semelhante a 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
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

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.