public function postLink($url, $text, $postData = [], $htmlOptions = [], $checkAccess = true, $confirm = false){
        if ($checkAccess && is_array($url)){
            $module = isset($url[3])?$url[3]:((isset($url[2]) && is_string($url[2]))?$url[2]:null);
            if (!WebApp::get()->hasAccessTo($url[0], isset($url[1])?$url[1]:null, $module)){
                return ""; // is not visible;
            }
        }
        if (is_array($url)){
            $module = isset($url[3])?$url[3]:((isset($url[2]) && is_string($url[2]))?$url[2]:null);
            $url = WebApp::get()->request()->createURL($url[0], isset($url[1])?$url[1]:null, (isset($url[2])&&is_array($url[2]))?$url[2]:[], $module);
        }
        $uniqueID = uniqid("post-link-form");

        $htmlOptions['onclick'] = (isset($htmlOptions['onclick'])?$htmlOptions['onclick']. ' ':'') . 'document.getElementById(\''.$uniqueID.'\').submit(); return false;';
        if ($confirm){
            $htmlOptions['onclick'] = "if (confirm('$confirm')) { $htmlOptions[onclick] }; return false;";
        }
        $r = $this->link($url, $text, $htmlOptions, false);
        $r .= Form::get()->openForm(['style' => 'display:none;', 'method' => 'post', 'id' => $uniqueID, 'action' => $url]);
        foreach ($postData as $name=>$value){
            $r .= Form::get()->hiddenInput($name, $value);
        }
        $r .= Form::get()->closeForm();

        return $r;
    }
public function postLink($url, $text, $postData = [], $htmlOptions = [], $checkAccess = true, $confirm = false){
        if ($checkAccess && is_array($url)){
            $module = isset($url[3])?$url[3]:((isset($url[2]) && is_string($url[2]))?$url[2]:null);
            if (!WebApp::get()->hasAccessTo($url[0], isset($url[1])?$url[1]:null, $module)){
                return ""; // is not visible;
            }
        }
        if (is_array($url)){
            $module = isset($url[3])?$url[3]:((isset($url[2]) && is_string($url[2]))?$url[2]:null);
            $url = WebApp::get()->request()->createURL($url[0], isset($url[1])?$url[1]:null, (isset($url[2])&&is_array($url[2]))?$url[2]:[], $module);
        }
        $uniqueID = uniqid("post-link-form");

        $htmlOptions['onclick'] = (isset($htmlOptions['onclick'])?$htmlOptions['onclick']. ' ':'') . 'document.getElementById(\''.$uniqueID.'\').submit(); return false;';
        if ($confirm){
            $htmlOptions['onclick'] = "if (confirm('$confirm')) { $htmlOptions[onclick] }; return false;";
        }
        $r = $this->link($url, $text, $htmlOptions, false);
        $r .= Form::get()->openForm(['style' => 'display:none;', 'method' => 'post', 'id' => $uniqueID, 'action' => $url]);
        foreach ($postData as $name=>$value){
            $r .= Form::get()->hiddenInput($name, $value);
        }
        $r .= Form::get()->closeForm();

        return $r;
    }
public function postLink ( $ url , $ text , $ postData = [ ] , $ htmlOptions = [ ] , $ checkAccess = true , $ confirm = false ) { if ( $ checkAccess && is_array ( $ url ) ) { $ module = isset ( $ url [ 3 ] ) ? $ url [ 3 ] : ( ( isset ( $ url [ 2 ] ) && is_string ( $ url [ 2 ] ) ) ? $ url [ 2 ] : null ) ; if ( ! WebApp :: get ( ) -> hasAccessTo ( $ url [ 0 ] , isset ( $ url [ 1 ] ) ? $ url [ 1 ] : null , $ module ) ) { return "" ; // is not visible; } } if ( is_array ( $ url ) ) { $ module = isset ( $ url [ 3 ] ) ? $ url [ 3 ] : ( ( isset ( $ url [ 2 ] ) && is_string ( $ url [ 2 ] ) ) ? $ url [ 2 ] : null ) ; $ url = WebApp :: get ( ) -> request ( ) -> createURL ( $ url [ 0 ] , isset ( $ url [ 1 ] ) ? $ url [ 1 ] : null , ( isset ( $ url [ 2 ] ) && is_array ( $ url [ 2 ] ) ) ? $ url [ 2 ] : [ ] , $ module ) ; } $ uniqueID = uniqid ( "post-link-form" ) ; $ htmlOptions [ 'onclick' ] = ( isset ( $ htmlOptions [ 'onclick' ] ) ? $ htmlOptions [ 'onclick' ] . ' ' : '' ) . 'document.getElementById(\'' . $ uniqueID . '\').submit(); return false;' ; if ( $ confirm ) { $ htmlOptions [ 'onclick' ] = "if (confirm('$confirm')) { $htmlOptions[onclick] }; return false;" ; } $ r = $ this -> link ( $ url , $ text , $ htmlOptions , false ) ; $ r .= Form :: get ( ) -> openForm ( [ 'style' => 'display:none;' , 'method' => 'post' , 'id' => $ uniqueID , 'action' => $ url ] ) ; foreach ( $ postData as $ name => $ value ) { $ r .= Form :: get ( ) -> hiddenInput ( $ name , $ value ) ; } $ r .= Form :: get ( ) -> closeForm ( ) ; return $ r ; }
It creates a link and a hidden form. That form will be submitted where the link is setup as URL.

@param string|array $url Url where form will be submitted
@param string $text Visible text for the link
@param array $postData List of hidden inputs that will be sent in form and the value for each.
@param array $htmlOptions An associative list of htmloptions. Name and value.
@param bool $checkAccess If $url is array then it will check if it has access to that page and if not it will not display the link
@param bool|string $confirm Use confirmation message. Can be false or string with the message for confirmation
@return string
It creates a link and a hidden form . That form will be submitted where the link is setup as URL .