Questions tagged «jhtml»

5
为什么仅在链接CSS文件时使用addStyleSheet或JHtml :: stylesheet?
根据Wiki页面Adding Javascript and CSS to Page,您可以添加一个样式表,addStyleSheet如下所示: $document = JFactory::getDocument(); $document->addStyleSheet($url); 或JHtml::stylesheet像这样: JHtml::stylesheet($url, array(), true); 但是Wiki页面“ 创建基本模板”指示学习者包括如下样式表: <head> <jdoc:include type="head" /> <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css"> </head> 这绕过addStyleSheet和JHtml::stylesheet。这是一个好主意吗?什么时候使用前者?什么时候使用后者? 注: JHtml::_("script", …)和JHtml::_("stylesheet", …)几乎完全一样JHtml::script和JHtml::stylesheet。请参阅做JHtml::_什么。
9 jhtml  jfactory 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.