The Author Text Control

The first control you need to add is the author text box. Create a new element that has the type set to text and author for the name. Then you set the label for the control, set its required flag to true, and set any other attributes you may need. In this case, you should set the size to 30 (Listing 3-7).

Listing 3-7. Creating the Author Text Box in application/forms/BugReportForm.php

$author = $this->createElement('text', 'author'); $author->setLabel('Enter your name:'); $author->setRequired(TRUE); $author->setAttrib('size', 30); $this->addElement($author);

+1 0

Average user rating: 5 stars out of 1 votes

Post a comment

  • Receive news updates via email from this site