Changeset 160 for trunk/trax/vendor/trax/action_view
- Timestamp:
- 03/01/06 23:00:59 (6 years ago)
- Location:
- trunk/trax/vendor/trax/action_view
- Files:
-
- 2 modified
-
helpers.php (modified) (1 diff)
-
helpers/form_helper.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/trax/vendor/trax/action_view/helpers.php
r152 r160 39 39 */ 40 40 function __construct($object_name = null, $attribute_name = null) { 41 $this->object_name = $object_name; 41 if(substr($object_name, -2) == "[]") { 42 $auto_index = true; 43 } 44 $this->auto_index = false; 45 $this->object_name = str_replace("[]", "", $object_name); 42 46 $this->attribute_name = $attribute_name; 43 47 $this->controller_name = $GLOBALS['current_controller_name']; 44 48 $this->controller_path = $GLOBALS['current_controller_path']; 45 49 $this->controller_object = $GLOBALS['current_controller_object']; 50 if($auto_index) { 51 $object = $this->object(); 52 if(is_object($object)) { 53 $index = $object->index_on; # should be primary key (usually id field) 54 $this->auto_index = $object->$index; 55 } 56 } 46 57 } 47 58 -
trunk/trax/vendor/trax/action_view/helpers/form_helper.php
r152 r160 77 77 * 78 78 */ 79 function add_default_name_and_id($options) { 80 if(array_key_exists("index", $options)) {79 function add_default_name_and_id($options) { 80 if(array_key_exists("index", $options)) { 81 81 $options["name"] = $options["name"] ? $options["name"] : $this->tag_name_with_index($options["index"]); 82 82 $options["id"] = $options["id"] ? $options["id"] : $this->tag_id_with_index($options["index"]);
