Elseif içerir ve bir dış değişken yankı?

0 Cevap php

Ben bir şablon adı alır ve büyük bir dizi içeren şablon PHP dosyası içeren bir Elseif deyimi var, bu sayfadaki sonuç verir.

$template = str_replace("-","_","{$_GET['select']}");
    if ($template == "cuatro"){
        include("templates/cuatro.php");
        echo $page_output;
    } elseif ($template == "ohlittl"){
        include("templates/ohlittl.php");
        echo $page_output;
    } else {
        echo "Sorry, template not found.";
    }

$page_output = "You've chosen $template_select[0].";

Oradan, ben $ page_output değişken bulamadık diyerek bir uyarı olsun.

Uyarı: 10 hattı üzerine ... \ \ template.php: Undefined variable: C page_output

Ben olsa dahil dosyasındaki değişken koyarsanız onu bulabilirsiniz. Ama bu değişken bu sayfada kalmaya çalışıyorum. Bunu nasıl tamamlayabilirim?

0 Cevap