public function attachHelper($helperName, FormHelperInterface $formHelper)
    {
        if ($this->isValidKey($helperName)) {
            if (is_null($formHelperType = $this->resolveHelperType($formHelper))) {
                throw new InvalidArgumentException('Unkown form helper instance given');
            }

            if ($this->hasHelper($formHelperType)) {
                $this->getHelperMap()->get($formHelperType)->set($helperName, $formHelper);
            } else {
                $helperMap = new Map();
                $helperMap->set($helperName, $formHelper);
                $this->getHelperMap()->set($formHelperType, $helperMap);
            }
        } else {
            throw new InvalidArgumentException('Invalid form helper name given');
        }
        return $this;
    }
public function attachHelper($helperName, FormHelperInterface $formHelper)
    {
        if ($this->isValidKey($helperName)) {
            if (is_null($formHelperType = $this->resolveHelperType($formHelper))) {
                throw new InvalidArgumentException('Unkown form helper instance given');
            }

            if ($this->hasHelper($formHelperType)) {
                $this->getHelperMap()->get($formHelperType)->set($helperName, $formHelper);
            } else {
                $helperMap = new Map();
                $helperMap->set($helperName, $formHelper);
                $this->getHelperMap()->set($formHelperType, $helperMap);
            }
        } else {
            throw new InvalidArgumentException('Invalid form helper name given');
        }
        return $this;
    }
public function attachHelper ( $ helperName , FormHelperInterface $ formHelper ) { if ( $ this -> isValidKey ( $ helperName ) ) { if ( is_null ( $ formHelperType = $ this -> resolveHelperType ( $ formHelper ) ) ) { throw new InvalidArgumentException ( 'Unkown form helper instance given' ) ; } if ( $ this -> hasHelper ( $ formHelperType ) ) { $ this -> getHelperMap ( ) -> get ( $ formHelperType ) -> set ( $ helperName , $ formHelper ) ; } else { $ helperMap = new Map ( ) ; $ helperMap -> set ( $ helperName , $ formHelper ) ; $ this -> getHelperMap ( ) -> set ( $ formHelperType , $ helperMap ) ; } } else { throw new InvalidArgumentException ( 'Invalid form helper name given' ) ; } return $ this ; }
add form helper

@param       string                  $helperName         form helper name
@param       FormHelperInterface     $formHelper         form helper instance
@return      FormHelperMap       form helper map for fluent interface

@throws InvalidArgumentException
add form helper