Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将字符串添加到joomla标头?_Joomla - Fatal编程技术网

如何将字符串添加到joomla标头?

如何将字符串添加到joomla标头?,joomla,Joomla,我知道使用JFactory::getDocument()我可以向标题中添加一些JS代码,但目前我需要添加这种行是否有一些默认方法?您可以使用Jdocument来完成此操作: $document=JFactory::getDocument(); $customtag='<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../excanvas.min.js"></scr

我知道使用
JFactory::getDocument()
我可以向标题中添加一些JS代码,但目前我需要添加这种行
是否有一些默认方法?

您可以使用Jdocument来完成此操作:

$document=JFactory::getDocument();
$customtag='<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../excanvas.min.js"></script><![endif]--> ';
$document->addCustomTag( $customtag);
$document=JFactory::getDocument();
$customtag='';
$document->addCustomTag($customtag);