Development

Changeset 10204

You must first sign up to be able to contribute.

Changeset 10204

Show
Ignore:
Timestamp:
07/10/08 18:45:26 (5 years ago)
Author:
Kris.Wallsmith
Message:

sfFormtasticPlugin: added logic to render all hidden form fields

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfFormtasticPlugin/trunk/lib/form/sfFormtasticBase.class.php

    r10202 r10204  
    4444  public function renderHiddenFields() 
    4545  { 
     46    $rendered = array(); 
     47    foreach ($this->widgetSchema->getHiddenWidgets() as $widget) 
     48    { 
     49      $rendered[] = $widget->render(); 
     50    } 
     51     
     52    return join("\n", $rendered); 
    4653  } 
    4754} 
  • plugins/sfFormtasticPlugin/trunk/lib/widget/sfWidgetasticFormSchemaBase.class.php

    r10203 r10204  
    2323    $this->addFormFormatter('dl', new sfWidgetasticFormFormatterDefinitionList); 
    2424  } 
     25   
     26  /** 
     27   * @return array All hidden form widgets 
     28   */ 
     29  public function getHiddenWidgets() 
     30  { 
     31    $hiddenWidgets = array(); 
     32    foreach ($this->positions as $name) 
     33    { 
     34      $widget = $this[$name]; 
     35      if ($widget instanceof sfWidgetForm && $widget->isHidden()) 
     36      { 
     37        $hiddenWidgets[] = $widget; 
     38      } 
     39    } 
     40     
     41    return $hiddenWidgets; 
     42  } 
    2543}