私は自分でCMSを作成しましたが、PHPバージョン5.6までうまく動作します。 PHP7が始まりました。私のCMSは準備が整いました。 このCMSではPEARライブラリを使用しています。このライブラリは、バージョン1.1oにアップグレードしました。このバージョンはPHP7をサポートしているためです。PEAR HTML_Template_ITはPHP7のTemplatefileをロードしません。
今、私はパッケージはHTML_Template_ITの問題を次ています(「メタタグ」)setCurrentBlockテンプレートファイルをロードしようとし、その後、私はメッセージがメタタグ」
「このブロックを見つけることができません」を取得する場合?!ここ
require_once('HTML/Template/ITX.php');
$tpl = new HTML_Template_ITX(TEMPLATE_DIR);
// Einlesen der Haupttemplate-Datei
$tpl->loadTemplatefile('main_tpl.html', true, true);
// Meta-Tags ausgeben
$tpl->setCurrentBlock('meta-tags');
$tpl->setVariable('author', AUTHOR);
$tpl->setVariable('description', DESCRIPTION);
$tpl->setVariable('keywords', KEYWORDS);
$tpl->setVariable('page_topic', PAGE_TOPIC);
$tpl->setVariable('publisher', PUBLISHER);
$tpl->setVariable('google_verify', GOOGLE_VERIFY);
$tpl->parseCurrentBlock();
から対応するディテールです:同じ問題を抱えていたし、それを解決することができ はあなたの助けをとても感謝index.phpの中で私のコードをだ
がそこに誰もが、あります私のテンプレート-Fil Eのmain_tpl.html:<!-- BEGIN meta-tags -->
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="author" content="{author}" />
<meta name="Content-Language" content="de" />
<meta name="description" content="{description}" />
<meta name="keywords" content="{keywords}" />
<meta name="page-topic" content="{page_topic}" />
<meta name="publisher" content="{publisher}" />
<meta name="google-site-verification" content="{google_verify}" />
<meta name="rating" content="general" />
<meta name="revisit-after" content="10 days" />
<meta name="robots" content="index, follow" />
<!-- END meta-tags -->
ブラウザでの出力です:
Cannot find this block"meta-tags'
ありがとうございます。 –