本文整理汇总了PHP中Q_Html::themedUrlAndFilename方法的典型用法代码示例。如果您正苦于以下问题:PHP Q_Html::themedUrlAndFilename方法的具体用法?PHP Q_Html::themedUrlAndFilename怎么用?PHP Q_Html::themedUrlAndFilename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q_Html
的用法示例。
在下文中一共展示了Q_Html::themedUrlAndFilename方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: stylesheetsInline
/**
* Returns a <style> tag with the content of all the stylesheets included inline
* @method stylesheetsInline
* @static
* @param {array} [$styles=array()] If not empty, this associative array contains styles which will be
* included at the end of the generated <style> tag.
* @param {string} [$slotName=null] If provided, returns only the stylesheets added while filling this slot.
* @return {string} the style tags and their contents inline
*/
static function stylesheetsInline($styles = array(), $slotName = null)
{
if (empty(self::$stylesheets)) {
return '';
}
$sheets = self::stylesheetsArray($slotName, false);
$sheets_for_slots = array();
if (!empty($sheets)) {
foreach ($sheets as $stylesheet) {
$href = '';
$media = 'screen, print';
$type = 'text/css';
extract($stylesheet, EXTR_IF_EXISTS);
$ob = new Q_OutputBuffer();
if (Q_Valid::url($href)) {
try {
include $href;
} catch (Exception $e) {
}
} else {
list($href, $filename) = Q_Html::themedUrlAndFilename($href);
try {
Q::includeFile($filename);
} catch (Exception $e) {
}
}
$sheets_for_slots[$stylesheet['slot']][] = "\n/* Included inline from {$href} */\n" . $ob->getClean();
}
}
$parts = array();
foreach ($sheets_for_slots as $slot => $texts) {
$parts[] = Q_Html::tag('style', array('data-slot' => $slot), implode("\n\n", $texts));
}
return implode("", $parts);
}