SlideShare a Scribd company logo
1 of 15
by Tya Herlina
• Zend_Form is library in Zend Framework for creating
form object.
• Why Zend_Form 1.7?
• In Buzoo Indonesia, we use Zend Framework version 1.7
• HOW to?
$form = new Zend_Form();
• Simplifies form creation,
• Simplifies form handling in your web application.
• Element input filtering and validation
• Element ordering
• Element and Form rendering, including escaping
• Element and form grouping
• Element and form-level configuration
It heavily leverages other Zend Framework components to
accomplish its goals, including :
• Zend_Config
• Zend_Validate
• Zend_Filter
• Zend_Loader_PluginLoader
• Zend_View [optionally]
• button
• checkbox
• multicheckbox
• hidden
• image
• password
• radio
• reset
• select
• submit
• text
• textarea
• etc (see
Zend_Form_Element_*)
• Alnum
• Alpha
• Date
• Digits
• EmailAddress
• StringLength
• Regex
• Etc (See Zend_Validate_*)
• getElement($name)
• getElements() setDefaults(array $defaults)
• setDefault($name, $value)
• getValue($name)
• getValues()
• etc
• Example ---- We want to register account in :
www.buzoolecture.com/register/form
• Registration Form
• Nickname (Required, Min. 6 char, Max. 10 char, must be Alpha
and Number)
• Gender (Required)
• Phone (Required, must be number)
• Email Address (Required)
• Password (Required)
• Confirmation Password (Required, must be same with Password)
• Enables developers to store configuration data in a familiar INI
format and read them in the application by using nested object
property syntax.
$config = new Zend_Config_Ini('/path/to/config.ini',
„section_name„, $options);
• By default, the key separator character is the period character
(.)
• This can be changed :
$options['nestSeparator'] = ':';
• Comments start with (;), as in php.ini
• Zend_Config_Ini utilizes the parse_ini_file() PHP function.
• Example : http://id1.php.net/parse_ini_file
[form]
register.form.action = "/dietitian/register/form"
register.form.method = "post"
; nickname
register.form.elements.nickname.type = "text"
register.form.elements.nickname.options.required = true
register.form.elements.nickname.options.validators.alnum.validator =
"Alnum"
register.form.elements.nickname.options.validators.strlen.validator =
"StringLength"
register.form.elements.nickname.options.validators.strlen.options.min =
"6"
register.form.elements.nickname.options.validators.strlen.options.max =
"10"
register.form.elements.nickname.errors.isEmpty = "Must be filled."
register.form.elements.nickname.errors.other = "Please enter correctly."
; gender
register.form.elements.gender.type = "radio"
register.form.elements.gender.options.required = true
register.form.elements.gender.errors.isEmpty = "Must be filled."
register.form.elements.gender.errors.other = "Please choose correctly."
; phone
register.form.elements.phone.type = "text"
register.form.elements.phone.options.required = true
register.form.elements.phone.options.validators.digits.validator =
"Digits"
register.form.elements.phone.errors.isEmpty = "Must be filled."
register.form.elements.phone.errors.other = "Please enter correctly.“
; email
register.form.elements.email.type = "text"
register.form.elements.email.options.required = true
register.form.elements.email.options.validators.email.validator =
"EmailAddress"
register.form.elements.email.errors.isEmpty = "Must be filled."
register.form.elements.email.errors.other = "Please enter correctly."
; password
register.form.elements.password.type = "password"
register.form.elements.password.options.required = true
register.form.elements.password.errors.place = "err_password"
register.form.elements.password.errors.isEmpty = "Must be filled."
register.form.elements.password.errors.other = "Please enter correctly."
; conf_password
register.form.elements.conf_password.type = "password"
register.form.elements.conf_password.options.required = true
register.form.elements.conf_password.errors.place = "err_password"
register.form.elements.conf_password.errors.isEmpty = "Must be filled."
register.form.elements.conf_password.errors.other = "Please enter
correctly."
public function formAction() {
//get register.ini file
$config = new Zend_Config_Ini(„/path/to/register.ini‟, 'form');
//define form
$form = new Zend_Form($config->register->form);
$this->view->form = $form;
//set option for element gender
$form->getElement('gender')->setMultiOptions(array('1' => 'Male', '2' => 'Female'));
$form->getElement('gender')->setSeparator(' ');
//if submit button pressed
if ( $this->getRequest()->isPost() ) {
//isValid is function from Zend
if ($form->isValid($_POST) ) {
//get value for checking confirmation password must be same with password
if( $form->getValue(„password‟) == $form->getValue(„conf_password‟) ) {
echo “Complete!!”;
} else {
echo “Ups, Sorry! Confirmation Password must be same with Password”;
}
}
}
}
<form action="/register/form" method="post" name="form1" id="form1">
Nickname : <?= $this->form->getElement('nickname') ?><br>
Gender : <?= $this->form->getElement('gender') ?><br>
Phone : <?= $this->form->getElement('phone') ?><br>
Email : <?= $this->form->getElement('email') ?><br>
Password : <?= $this->form->getElement('password') ?><br>
Confirmation Password<?= $this->form->getElement(„conf_password') ?><br>
<input type="submit" value="Register"/>
</form>
More information can be found at the Zend Framework
website
http://framework.zend.com/manual/1.7/en/index.html
Thank you~

More Related Content

Recently uploaded

Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdfssuserdda66b
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 

Recently uploaded (20)

Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 

Featured

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 HealthThinkNow
 
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.pdfmarketingartwork
 
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 2024Neil Kimberley
 
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)contently
 
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 2024Albert Qian
 
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 InsightsKurio // The Social Media Age(ncy)
 
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 2024Search Engine Journal
 
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 summarySpeakerHub
 
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 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 Tessa Mero
 
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 IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
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 managementMindGenius
 
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...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

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...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

Zend Form 1.7 Tutorial [PT.Buzoo Indonesia]

  • 2. • Zend_Form is library in Zend Framework for creating form object. • Why Zend_Form 1.7? • In Buzoo Indonesia, we use Zend Framework version 1.7 • HOW to? $form = new Zend_Form();
  • 3. • Simplifies form creation, • Simplifies form handling in your web application.
  • 4. • Element input filtering and validation • Element ordering • Element and Form rendering, including escaping • Element and form grouping • Element and form-level configuration It heavily leverages other Zend Framework components to accomplish its goals, including : • Zend_Config • Zend_Validate • Zend_Filter • Zend_Loader_PluginLoader • Zend_View [optionally]
  • 5. • button • checkbox • multicheckbox • hidden • image • password • radio • reset • select • submit • text • textarea • etc (see Zend_Form_Element_*)
  • 6. • Alnum • Alpha • Date • Digits • EmailAddress • StringLength • Regex • Etc (See Zend_Validate_*)
  • 7. • getElement($name) • getElements() setDefaults(array $defaults) • setDefault($name, $value) • getValue($name) • getValues() • etc
  • 8. • Example ---- We want to register account in : www.buzoolecture.com/register/form • Registration Form • Nickname (Required, Min. 6 char, Max. 10 char, must be Alpha and Number) • Gender (Required) • Phone (Required, must be number) • Email Address (Required) • Password (Required) • Confirmation Password (Required, must be same with Password)
  • 9. • Enables developers to store configuration data in a familiar INI format and read them in the application by using nested object property syntax. $config = new Zend_Config_Ini('/path/to/config.ini', „section_name„, $options); • By default, the key separator character is the period character (.) • This can be changed : $options['nestSeparator'] = ':'; • Comments start with (;), as in php.ini • Zend_Config_Ini utilizes the parse_ini_file() PHP function. • Example : http://id1.php.net/parse_ini_file
  • 10. [form] register.form.action = "/dietitian/register/form" register.form.method = "post" ; nickname register.form.elements.nickname.type = "text" register.form.elements.nickname.options.required = true register.form.elements.nickname.options.validators.alnum.validator = "Alnum" register.form.elements.nickname.options.validators.strlen.validator = "StringLength" register.form.elements.nickname.options.validators.strlen.options.min = "6" register.form.elements.nickname.options.validators.strlen.options.max = "10" register.form.elements.nickname.errors.isEmpty = "Must be filled." register.form.elements.nickname.errors.other = "Please enter correctly." ; gender register.form.elements.gender.type = "radio" register.form.elements.gender.options.required = true register.form.elements.gender.errors.isEmpty = "Must be filled." register.form.elements.gender.errors.other = "Please choose correctly." ; phone register.form.elements.phone.type = "text" register.form.elements.phone.options.required = true register.form.elements.phone.options.validators.digits.validator = "Digits" register.form.elements.phone.errors.isEmpty = "Must be filled." register.form.elements.phone.errors.other = "Please enter correctly.“ ; email register.form.elements.email.type = "text" register.form.elements.email.options.required = true register.form.elements.email.options.validators.email.validator = "EmailAddress" register.form.elements.email.errors.isEmpty = "Must be filled." register.form.elements.email.errors.other = "Please enter correctly." ; password register.form.elements.password.type = "password" register.form.elements.password.options.required = true register.form.elements.password.errors.place = "err_password" register.form.elements.password.errors.isEmpty = "Must be filled." register.form.elements.password.errors.other = "Please enter correctly." ; conf_password register.form.elements.conf_password.type = "password" register.form.elements.conf_password.options.required = true register.form.elements.conf_password.errors.place = "err_password" register.form.elements.conf_password.errors.isEmpty = "Must be filled." register.form.elements.conf_password.errors.other = "Please enter correctly."
  • 11. public function formAction() { //get register.ini file $config = new Zend_Config_Ini(„/path/to/register.ini‟, 'form'); //define form $form = new Zend_Form($config->register->form); $this->view->form = $form; //set option for element gender $form->getElement('gender')->setMultiOptions(array('1' => 'Male', '2' => 'Female')); $form->getElement('gender')->setSeparator(' '); //if submit button pressed if ( $this->getRequest()->isPost() ) { //isValid is function from Zend if ($form->isValid($_POST) ) { //get value for checking confirmation password must be same with password if( $form->getValue(„password‟) == $form->getValue(„conf_password‟) ) { echo “Complete!!”; } else { echo “Ups, Sorry! Confirmation Password must be same with Password”; } } } }
  • 12.
  • 13. <form action="/register/form" method="post" name="form1" id="form1"> Nickname : <?= $this->form->getElement('nickname') ?><br> Gender : <?= $this->form->getElement('gender') ?><br> Phone : <?= $this->form->getElement('phone') ?><br> Email : <?= $this->form->getElement('email') ?><br> Password : <?= $this->form->getElement('password') ?><br> Confirmation Password<?= $this->form->getElement(„conf_password') ?><br> <input type="submit" value="Register"/> </form>
  • 14. More information can be found at the Zend Framework website http://framework.zend.com/manual/1.7/en/index.html