Tutaj potrzebna jest odrobina pomocy PHP, zawarta w niej zawartość pojawia się jako "1", co oznacza, że jest prawdziwa, ale potrzebuje jej zawartości i nie jest pewna, dlaczego tak się nie stało. Oto skrócona wersja funkcji:Korzystanie z include() w ramach ob_start()
public function content {
$website->content = 'Some content here. ';
ob_start();
include('myfile.php');
$file_content = ob_end_clean();
$website->content .= $file_content;
$website->content .= ' Some more content here.';
echo $website->content;
}
This wyjścia:
Some content here 1 Some more content here
Kiedy potrzebuję go do wyjścia:
Some content here 'Included file content here' Some more content here
Każdy pomysł, w jaki sposób mogę rozwiązać ten problem?
Dziękuję, to działa. –