Changeset 2914

Show
Ignore:
Timestamp:
06/25/2008 05:45:11 PM (5 months ago)
Author:
Shadowhand
Message:

Optimizing form::open() and form::attributes()

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/helpers/form.php

    r2911 r2914  
    4242                } 
    4343 
     44                // Set action 
     45                $attr['action'] = $action; 
     46 
    4447                // Form opening tag 
    45                 $form = '<form action="'.$action.'"'.form::attributes($attr).'>'."\n"; 
     48                $form = '<form'.form::attributes($attr).'>'."\n"; 
    4649 
    4750                // Add hidden fields immediate after opening tag 
     
    452455                        return ''; 
    453456 
    454                 if ($type === NULL AND ! empty($attr['type'])) 
    455                 { 
    456                         // Set the type by the attributes 
    457                         $type = $attr['type']; 
    458                 } 
    459  
    460457                if (isset($attr['name']) AND empty($attr['id']) AND strpos($attr['name'], '[') === FALSE) 
    461458                { 
     459                        if ($type === NULL AND ! empty($attr['type'])) 
     460                        { 
     461                                // Set the type by the attributes 
     462                                $type = $attr['type']; 
     463                        } 
     464 
    462465                        switch ($type) 
    463466                        { 
     
    479482                $order = array 
    480483                ( 
     484                        'action', 
     485                        'method', 
    481486                        'type', 
    482487                        'id',