Development

#3939 (Little typo error in form documentation)

You must first sign up to be able to contribute.

Ticket #3939 (closed documentation: fixed)

Opened 3 months ago

Last modified 3 months ago

Little typo error in form documentation

Reported by: mikael.randy Assigned to: fabien
Priority: minor Milestone:
Component: form Version: 1.1.0
Keywords: Cc:
Qualification: Unreviewed

Description

Hello,

I just try to upgrade my knowledge of Symfony 1.0 forms to Sf1.1 method. For this, i read official documentation on forms (http://www.symfony-project.org/book/forms/1_1/fr/)

To explain how to use select checkbox, a static attribute is added to the ContactForm? class in Listing 1-9

class ContactForm extends sfForm
{
  protected $subjects = array('Subject A', 'Subject B', 'Subject C'); 

Later in class, this attribut is use statically

new sfWidgetFormSelect(array('choices' => self::$subjects)) 

Execution of this class give an error : Fatal error: Access to undeclared static property: ContactForm::$subjects in ...

Correct code for static declaration is

  protected static $subjects = array('Subject A', 'Subject B', 'Subject C'); 

Change History

07/13/08 23:39:11 changed by Carl.Vondrick

  • status changed from new to closed.
  • resolution set to fixed.

(In [10269]) forms book: fixed #3939