SlideShare une entreprise Scribd logo
1  sur  55
Télécharger pour lire hors ligne
Dutch PHP Conference 2011
Martin de Keijzer
Let’s take over the world
with Zend Framework
Monday, 23 May 2011
Introduction
2
Monday, 23 May 2011
Introduction
Martin de Keijzer
Software engineer at Ibuildings
Board member of PHPBenelux
PHP 5 Zend Certified Engineer
Twitter: Martin1982
Joind.in: http://joind.in/3253
Blog: www.martindekeijzer.nl
3
Monday, 23 May 2011
DISCLAIMER
DISCLAIMER: ALL EXAMPLE CODE
IS WRITTEN IN THE CONTROLLER BY
EXAMPLE! USE MODELS!!!!
4
Monday, 23 May 2011
Monday, 23 May 2011
The case
6
What do we need to take over the
world?
Monday, 23 May 2011
The case
✓Location (Country and region)
✓Language
✓Date and time
✓Currency
✓Measuring
7
Monday, 23 May 2011
“Location! Location! Location!”
Quote from Achmed (2009)
8
Monday, 23 May 2011
Zend Locale
Monday, 23 May 2011
A locale defines a country (territory) and a language to
bind the various localized information to it.
Zend Locale
10
Monday, 23 May 2011
Zend Locale
nl_NL
de_BE
fr_BE
nl_BE
11
Monday, 23 May 2011
CLDR
Common Locale Data Repository
http://cldr.unicode.org
Zend Locale
12
Monday, 23 May 2011
Zend Locale
13
Monday, 23 May 2011
Zend Locale
The current locale is is: nl
The browser's locale is is: nl
The environment's locale is is: de_DE
The set locale is is: en_US
14
Monday, 23 May 2011
Zend Locale
15
Monday, 23 May 2011
Zend Locale
16
Monday, 23 May 2011
Zend Locale
17
In FR people speak fr
Monday, 23 May 2011
Zend Locale
18
In FR people speak fr.
In France people speak French.
Monday, 23 May 2011
Zend Locale
19
Monday, 23 May 2011
Zend Locale
20
Monday, 23 May 2011
Zend Locale
array(6) {
["yes"]=>
string(2) "ja"
["no"]=>
string(3) "nee"
}
21
Monday, 23 May 2011
Zend Locale
["yesarray"]=>
array(2) {
[0]=>string(2) "ja"
[1]=>string(1) "j"
}
["noarray"]=>
array(2) {
[0]=>string(3) "nee"
[1]=>string(1) "n"
}
22
Monday, 23 May 2011
Zend Locale
["yesexpr"]=>
string(20) "^([jJ][aA]?)|([jJ]?)"
["noexpr"]=>
string(26) "^([nN]([eE][eE])?)|
([nN]?)"
23
Monday, 23 May 2011
Zend Locale
A list of supported locales:
http://framework.zend.com/manual/
en/zend.locale.appendix.html
24
Monday, 23 May 2011
Zend Locale
Utilized by:
Zend_Controller_Router
Zend_Currency
Zend_Date
Zend_Filter
Zend_Measure
Zend_Service_Technorati
Zend_Timesync
Zend_Translate
Zend_Validate
25
Monday, 23 May 2011
Speaking the language
Zend_Translate
26
Monday, 23 May 2011
Zend Translate
Operates using adapters:
Array
Csv
Gettext
Tbx
Tmx
Qt
Xliff
Xmltm
27
Monday, 23 May 2011
Zend Translate
28
Monday, 23 May 2011
Zend Translate
29
Monday, 23 May 2011
Zend Translate
30
nl.php
fr.php
Monday, 23 May 2011
Zend Translate
31
my-view.phtml
Monday, 23 May 2011
Zend Locale
32
Monday, 23 May 2011
Zend Locale
Quick hint: Google uses locales too!
Zend Framework is your gateway to more power!
33
Monday, 23 May 2011
Monday, 23 May 2011
Do not get lost in time
Zend_Date
35
Monday, 23 May 2011
Zend Date
The date is May 2, 2011 9:13:41 PM.
The date is 2 mei 2011 21:13:41.
36
Monday, 23 May 2011
Zend Timesync
37
2 mai 2011 21:25:09
Monday, 23 May 2011
Zend_Locale revisited
38
You can use Zend_Locale_Format to override
date and number formatting.
I never had any use for it though.....
Monday, 23 May 2011
Show me the money!
Zend_Currency
39
Monday, 23 May 2011
Zend Currency
40
Monday, 23 May 2011
Zend Currency
In the Netherlands you pay with Euro (€).
And in the UK you pay with British Pound
Sterling (£).
41
Monday, 23 May 2011
Zend Currency
42
Monday, 23 May 2011
Zend Currency
43
Please hand me 10.00
US Dollar for food and
shelter.
Monday, 23 May 2011
Zend Currency
44
Got lost in locales?
getCurrencyList()
getRegionList()
getLocale()
Monday, 23 May 2011
Never trust a user!
Zend_Validate
45
Monday, 23 May 2011
Zend Validate
46
Monday, 23 May 2011
Zend Validate
47
Monday, 23 May 2011
Measures please?
Zend_Measure
48
Monday, 23 May 2011
Zend Measure
49
Monday, 23 May 2011
Zend Measure
50
A Big Mac’s weight is 200,05 g in the Netherlands.
In the USA this would be
0.441034755500847600236309 lbs
Monday, 23 May 2011
Zend Measure
Zend_Measure doesn’t utilize locales to give you
the correct units, but only the correct number
formats.
51
Monday, 23 May 2011
Conclusion
52
Monday, 23 May 2011
Image sources
Achmed http://barenakedislam.wordpress.com/2011/01/27/sweden-muslim-offended-by-ahmed-the-dead-terrorist-demands-compensation-for-mental-
anguish/jeff-dunham_achmed/
Clocks http://blogs.manageengine.com/image/501000000062207/timezones.jpg
Cat http://icanhascheezburger.com
Pinky & the brain http://blogg.visir.is/purplemagic/category/truarbrogð/
Zend Framework logo http://www.myskills.be/
Sneaking in: http://fakeposters.com
53
Monday, 23 May 2011
Questions ?
54
Monday, 23 May 2011
Thank you!
Contact details:
Twitter: @Martin1982
Blog: http://www.martindekeijzer.nl
Please give feedback on Joind.in!
http://joind.in/3253
Monday, 23 May 2011

Contenu connexe

Dernier

Dernier (20)

Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdf
 
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...
 
The UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoThe UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, Ocado
 
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
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Buy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfBuy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdf
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
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
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
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
 

En vedette

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Let's take over the world with Zend Framework