Development

Changeset 11357

You must first sign up to be able to contribute.

Changeset 11357

Show
Ignore:
Timestamp:
09/06/08 20:08:06 (3 months ago)
Author:
fabien
Message:

[1.2] added sfForm::renderFormTag() method

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfPropelPlugin/trunk/lib/propel/form/sfFormPropel.class.php

    r11113 r11357  
    257257 
    258258  /** 
     259   * Renders a form tag suitable for the related Propel object. 
     260   * 
     261   * The method is automatically guessed based on the Propel object: 
     262   * 
     263   *  * if the object is new, the method is POST 
     264   *  * if the object already exists, the method is PUT 
     265   * 
     266   * @param  string $url         The URL for the action 
     267   * @param  array  $attributes  An array of HTML attributes 
     268   * 
     269   * @return string An HTML representation of the opening form tag 
     270   * 
     271   * @see sfForm 
     272   */ 
     273  public function renderFormTag($url, array $attributes = array()) 
     274  { 
     275    $attributes['method'] = $this->getObject()->isNew() ? 'POST' : 'PUT'; 
     276 
     277    return parent::renderFormTag($url, $attributes); 
     278  } 
     279 
     280  /** 
    259281   * Updates and saves the current object. 
    260282   *