admin/controllers/Invoice.php
protected function validatePost()
    {
        $oFormValidation = Factory::service('FormValidation');

        $aRules = [
            'ref'             => 'trim',
            'state'           => 'trim|required',
            'dated'           => 'trim|required|valid_date',
            'currency'        => 'trim|required|callback__callbackValidCurrency',
            'terms'           => 'trim|is_natural',
            'customer_id'     => 'trim',
            'additional_text' => 'trim',
            'items'           => '',
        ];

        $aRulesFV = [];
        foreach ($aRules as $sKey => $sRules) {
            $aRulesFV[] = [
                'field' => $sKey,
                'label' => '',
                'rules' => $sRules,
            ];
        }

        $oFormValidation->set_rules($aRulesFV);

        $oFormValidation->set_message('required', lang('fv_required'));
        $oFormValidation->set_message('valid_date', lang('fv_valid_date'));
        $oFormValidation->set_message('is_natural', lang('fv_is_natural'));
        $oFormValidation->set_message('valid_email', lang('fv_valid_email'));

        return $oFormValidation->run($this);
    }
protected function validatePost()
    {
        $oFormValidation = Factory::service('FormValidation');

        $aRules = [
            'ref'             => 'trim',
            'state'           => 'trim|required',
            'dated'           => 'trim|required|valid_date',
            'currency'        => 'trim|required|callback__callbackValidCurrency',
            'terms'           => 'trim|is_natural',
            'customer_id'     => 'trim',
            'additional_text' => 'trim',
            'items'           => '',
        ];

        $aRulesFV = [];
        foreach ($aRules as $sKey => $sRules) {
            $aRulesFV[] = [
                'field' => $sKey,
                'label' => '',
                'rules' => $sRules,
            ];
        }

        $oFormValidation->set_rules($aRulesFV);

        $oFormValidation->set_message('required', lang('fv_required'));
        $oFormValidation->set_message('valid_date', lang('fv_valid_date'));
        $oFormValidation->set_message('is_natural', lang('fv_is_natural'));
        $oFormValidation->set_message('valid_email', lang('fv_valid_email'));

        return $oFormValidation->run($this);
    }
protected function validatePost ( ) { $ oFormValidation = Factory :: service ( 'FormValidation' ) ; $ aRules = [ 'ref' => 'trim' , 'state' => 'trim|required' , 'dated' => 'trim|required|valid_date' , 'currency' => 'trim|required|callback__callbackValidCurrency' , 'terms' => 'trim|is_natural' , 'customer_id' => 'trim' , 'additional_text' => 'trim' , 'items' => '' , ] ; $ aRulesFV = [ ] ; foreach ( $ aRules as $ sKey => $ sRules ) { $ aRulesFV [ ] = [ 'field' => $ sKey , 'label' => '' , 'rules' => $ sRules , ] ; } $ oFormValidation -> set_rules ( $ aRulesFV ) ; $ oFormValidation -> set_message ( 'required' , lang ( 'fv_required' ) ) ; $ oFormValidation -> set_message ( 'valid_date' , lang ( 'fv_valid_date' ) ) ; $ oFormValidation -> set_message ( 'is_natural' , lang ( 'fv_is_natural' ) ) ; $ oFormValidation -> set_message ( 'valid_email' , lang ( 'fv_valid_email' ) ) ; return $ oFormValidation -> run ( $ this ) ; }
Validate the POST data

@return boolean
@throws \Nails\Common\Exception\FactoryException
Validate the POST data