0

I am trying to create a plugin that includes wrapping the php code below around the $tagdata . Obviously this is not working. If anyone can point me in the right direction, I would greatly appreciate it. Even if your comment is, "You forgot about this moron!" I'll take it. Thank you in advance!

Peter T

$tagdata = ee()->TMPL->tagdata;     
$context = stream_context_create(array('http' => array('ignore_errors' => true)));
    if(!isset($_GET['tfa_next'])) {
        $qs = ' ';
        if(isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])){$qs='?'.$_SERVER['QUERY_STRING'];};
        echo file_get_contents("https://mydomain.com/rest/forms/view/$tagdata".$qs);

    } else {
        echo file_get_contents('https://mydomain.com/rest'.$_GET['tfa_next'],false,$context);
    }
  • Instead of echo, use return statement. If your data comes in file_get_contents, it will show in the place where you are using ee tag – Mufi - Amici Infotech Oct 29 at 5:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.