src/Form/Form.php
public static function open($form_attr=array()) 
        {
            //this try block is excecuted to enable throwing and catching of errors as appropriate
            try {
                
                     //this block throwing exception if method argument is not an array
                    if(! is_array($form_attr)){
                        throw new HelperException(sprintf('Expecting array of form attributes.e.g.$form_attr = array(\'name\'=>\'form1\',\'action\'=>\'post\')',$form_attr));
                    }
                    $form_attr_str='';
                    foreach($form_attr as $key=>$val){
                        $form_attr_str .= $key.'="'.$val.'" ';
                    }
                    //$form_attr_str = implode('= ',$form_attr);
                    return "<form ".$form_attr_str.' >';
            }

            catch(BaseException $e) {

                //echo $e->getMessage();
                $e->show();

            }

            catch(Exception $e) {

              echo $e->getMessage();

            }

        }
public static function open($form_attr=array()) 
        {
            //this try block is excecuted to enable throwing and catching of errors as appropriate
            try {
                
                     //this block throwing exception if method argument is not an array
                    if(! is_array($form_attr)){
                        throw new HelperException(sprintf('Expecting array of form attributes.e.g.$form_attr = array(\'name\'=>\'form1\',\'action\'=>\'post\')',$form_attr));
                    }
                    $form_attr_str='';
                    foreach($form_attr as $key=>$val){
                        $form_attr_str .= $key.'="'.$val.'" ';
                    }
                    //$form_attr_str = implode('= ',$form_attr);
                    return "<form ".$form_attr_str.' >';
            }

            catch(BaseException $e) {

                //echo $e->getMessage();
                $e->show();

            }

            catch(Exception $e) {

              echo $e->getMessage();

            }

        }
public static function open ( $ form_attr = array ( ) ) { //this try block is excecuted to enable throwing and catching of errors as appropriate try { //this block throwing exception if method argument is not an array if ( ! is_array ( $ form_attr ) ) { throw new HelperException ( sprintf ( 'Expecting array of form attributes.e.g.$form_attr = array(\'name\'=>\'form1\',\'action\'=>\'post\')' , $ form_attr ) ) ; } $ form_attr_str = '' ; foreach ( $ form_attr as $ key => $ val ) { $ form_attr_str .= $ key . '="' . $ val . '" ' ; } //$form_attr_str = implode('= ',$form_attr); return "<form " . $ form_attr_str . ' >' ; } catch ( BaseException $ e ) { //echo $e->getMessage(); $ e -> show ( ) ; } catch ( Exception $ e ) { echo $ e -> getMessage ( ) ; } }
Ths method create form open tag with attributes in view.

@param array $form_attr   Form attributes e.g. $form_attr = array('name'=>'form1','action'=>'post')
Ths method create form open tag with attributes in view .