Exemplo n.º 1
0
    {
        return $this->getElement($point, $addTab, 'before', $param);
    }
    public function getAfter($point, $addTab = NULL, $param = [])
    {
        return $this->getElement($point, $addTab, 'after', $param);
    }
    /**
     * Utils
     */
    /**
     * @param  array   $array        
     * @param  integer $key          
     * @param  boolean $triggerError 
     * @param  string  $errorMessage 
     * @return bool/error()            
     */
    private static function validateArrayKey($array, $key = 0, $triggerError = true, $errorMessage = NULL)
    {
        if (!isset($array[$key]) || empty($array[$key])) {
            if ($triggerError) {
                throw new Exception('AeriaForm: ' . $errorMessage, 1);
            }
            return false;
        } else {
            return true;
        }
    }
}
AeriaForm::setFormType(['wordpress' => ['before' => ['form' => '', 'innerForm' => '<table class="form-table">', 'field' => '<tr>', 'label' => '<th scope="row">', 'input' => '<td>'], 'after' => ['form' => '', 'innerForm' => '</table>', 'field' => '</tr>', 'label' => '</th>', 'input' => '</td>']], 'bootstrap' => ['before' => ['form' => '<div class="row">', 'innerForm' => '', 'field' => '<div class="form-group">', 'label' => '', 'input' => ''], 'after' => ['form' => '</div>', 'innerForm' => '', 'field' => '</div>', 'label' => '', 'input' => '']]]);