Changeset 2103

Show
Ignore:
Timestamp:
09/28/07 15:26:18 (16 months ago)
Author:
david
Message:

as a followup to [2102] and in addition to ${errorMessage}, error container markup snippets now also support ${elementId} and ${elementName} variables with the element id and name, respectively. refs #303

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/0.11/src/filter/AgaviFormPopulationFilter.class.php

    r2102 r2103  
    445445                  // %s is the placeholder in the HTML for the error message 
    446446                  $containerElement = $doc->createDocumentFragment(); 
    447                   $containerElement->appendXML(AgaviToolkit::expandVariables($errorContainer, array('errorMessages' => implode("\n", $errorStrings)))); 
     447                  $containerElement->appendXML( 
     448                    AgaviToolkit::expandVariables( 
     449                      $errorContainer, 
     450                      array( 
     451                        'elementId'     => $element->getAttribute('id'), 
     452                        'elementName'   => $element->getAttribute('name'), 
     453                        'errorMessages' => implode("\n", $errorStrings), 
     454                      ) 
     455                    ) 
     456                  ); 
    448457                } elseif(is_callable($errorContainer)) { 
    449458                  // it's a callback we can use to get a DOMElement