[Pieforms-commit] SF.net SVN: pieforms: [41] pieforms/src/pieform.php
Status: Alpha
Brought to you by:
oracleshinoda
From: <ora...@us...> - 2006-11-19 22:28:03
|
Revision: 41 http://svn.sourceforge.net/pieforms/?rev=41&view=rev Author: oracleshinoda Date: 2006-11-19 14:27:55 -0800 (Sun, 19 Nov 2006) Log Message: ----------- Store the form data in its own array. Eventually almost all fields will be merged into this. Added a method to get a property from this array. Added a todo about removing prefix and suffix support from core Modified Paths: -------------- pieforms/src/pieform.php Modified: pieforms/src/pieform.php =================================================================== --- pieforms/src/pieform.php 2006-11-19 12:25:31 UTC (rev 40) +++ pieforms/src/pieform.php 2006-11-19 22:27:55 UTC (rev 41) @@ -106,6 +106,14 @@ class Pieform { /** + * Data for the form + * + * @var array + * @todo move all of the member fields here into this field + */ + private $data = array(); + + /** * Maintains a tab index across all created forms, to make it easy for * people to forget about it and have it just work for all of their forms. * @@ -333,6 +341,7 @@ 'validatefunction' => '', ); $data = array_merge($formdefaults, $formconfig, $data); + $this->data = $data; // Set the method - only get/post allowed $data['method'] = strtolower($data['method']); @@ -557,6 +566,18 @@ } /** + * Returns a generic property. This can be used to retrieve any property + * set in the form data array, so developers can pass in random stuff and + * get access to it. + * + * @param string The key of the property to return + * @return mixed + */ + public function get_property($key) { + return $this->data[$key]; + } + + /** * Returns the form name * * @return string @@ -1229,6 +1250,7 @@ $builtelement = $function($element, $form); // Prepare the prefix and suffix + // @tod REMOVE THIS: each renderer should support it seperately $prefix = (isset($element['prefix'])) ? $element['prefix'] : ''; $suffix = (isset($element['suffix'])) ? $element['suffix'] : ''; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |