public function setForm($form)
    {
        // Associate Form Instance (via parent):
        
        parent::setForm($form);
        
        // Associate Rules with Fields:
        
        foreach ($this->rules as $fieldName => $rules) {
            
            if ($field = $this->getDataField($fieldName)) {
                
                foreach ($rules as $rule) {
                    $rule->setField($field);
                }
                
            }
            
        }
        
        // Associate Backend with Self:
        
        $this->backend->setFrontend($this);
        
        // Initialise Backend:
        
        $this->backend->doInit();
        
        // Define Form Classes:
        
        if ($classes = $this->getClassesForForm($form)) {
            
            foreach ($classes as $class) {
                $form->addExtraClass($class);
            }
            
        }
        
        // Define Form Attributes:
        
        if ($attributes = $this->getAttributesForForm($form)) {
            
            foreach ($attributes as $key => $value) {
                $form->setAttribute($key, $value);
            }
            
        }
        
        // Answer Self:
        
        return $this;
    }
public function setForm($form)
    {
        // Associate Form Instance (via parent):
        
        parent::setForm($form);
        
        // Associate Rules with Fields:
        
        foreach ($this->rules as $fieldName => $rules) {
            
            if ($field = $this->getDataField($fieldName)) {
                
                foreach ($rules as $rule) {
                    $rule->setField($field);
                }
                
            }
            
        }
        
        // Associate Backend with Self:
        
        $this->backend->setFrontend($this);
        
        // Initialise Backend:
        
        $this->backend->doInit();
        
        // Define Form Classes:
        
        if ($classes = $this->getClassesForForm($form)) {
            
            foreach ($classes as $class) {
                $form->addExtraClass($class);
            }
            
        }
        
        // Define Form Attributes:
        
        if ($attributes = $this->getAttributesForForm($form)) {
            
            foreach ($attributes as $key => $value) {
                $form->setAttribute($key, $value);
            }
            
        }
        
        // Answer Self:
        
        return $this;
    }
public function setForm ( $ form ) { // Associate Form Instance (via parent): parent :: setForm ( $ form ) ; // Associate Rules with Fields: foreach ( $ this -> rules as $ fieldName => $ rules ) { if ( $ field = $ this -> getDataField ( $ fieldName ) ) { foreach ( $ rules as $ rule ) { $ rule -> setField ( $ field ) ; } } } // Associate Backend with Self: $ this -> backend -> setFrontend ( $ this ) ; // Initialise Backend: $ this -> backend -> doInit ( ) ; // Define Form Classes: if ( $ classes = $ this -> getClassesForForm ( $ form ) ) { foreach ( $ classes as $ class ) { $ form -> addExtraClass ( $ class ) ; } } // Define Form Attributes: if ( $ attributes = $ this -> getAttributesForForm ( $ form ) ) { foreach ( $ attributes as $ key => $ value ) { $ form -> setAttribute ( $ key , $ value ) ; } } // Answer Self: return $ this ; }
Associates the form and data field instances with the validator and rules.

@param Form $form

@return $this
Associates the form and data field instances with the validator and rules .