本文整理汇总了PHP中Site::file方法的典型用法代码示例。如果您正苦于以下问题:PHP Site::file方法的具体用法?PHP Site::file怎么用?PHP Site::file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Site
的用法示例。
在下文中一共展示了Site::file方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
static function render($params, $tag, \GO\Site\Model\Content $content)
{
$html = '<a';
if (empty($params['slug']) && empty($params['path'])) {
return "Error: slug or path must be set in link tag!";
}
if (isset($params['slug'])) {
$params['slug'] = explode('#', $params['slug']);
$model = Content::model()->findBySlug($params['slug'][0], $content->site_id);
if (!$model) {
return "Broken link to slug: '" . $params['slug'][0] . "'";
}
$params['href'] = $model->getUrl();
if (isset($params['slug'][1])) {
$params['href'] .= '#' . $params['slug'][1];
}
} else {
$params['href'] = \Site::file($params['path'], false);
}
unset($params['anchor'], $params['slug'], $params['path']);
foreach ($params as $key => $value) {
$html .= ' ' . $key . '="' . $value . '"';
}
$html .= '>' . $tag['innerText'] . '</a>';
return $html;
}
示例2:
<?php
\Site::scripts()->registerCssFile(\Site::file('css/ticket.css'));
?>
<div class="external-ticket-page ticket">
<div class="wrapper">
<?php
if (\GO::user()) {
?>
<< <a id="back-to-overview-button" href="<?php
echo \Site::urlManager()->createUrl('tickets/externalpage/ticketlist');
?>
"><?php
echo \GO::t('ticketBackToList', 'defaultsite');
?>
</a>
<?php
}
?>
<h2><?php
echo \GO::t('ticket', 'defaultsite') . ' ' . $ticket->ticket_number;
?>
</h2>
<!-- <h3><?php
echo \GO::t('ticketContactInfo', 'defaultsite');
?>
</h3>
示例3: render
static function render($params, $tag, \GO\Site\Model\Content $content)
{
$html = '';
if (empty($params['path'])) {
return "Error: path attribute must be set in img tag!";
}
//Change Tickets.png into public/site/1/files/Tickets.png
$folder = new \GO\Base\Fs\Folder(Site::model()->getPublicPath());
$fullRelPath = $folder->stripFileStoragePath() . '/files/' . $params['path'];
// var_dump($p);
$thumbParams = $params;
unset($thumbParams['path'], $thumbParams['lightbox'], $thumbParams['alt'], $thumbParams['class'], $thumbParams['style'], $thumbParams['astyle'], $thumbParams['caption'], $thumbParams['aclass']);
if (!isset($thumbParams['lw']) && !isset($thumbParams['w'])) {
$thumbParams['lw'] = 300;
}
if (!isset($thumbParams['ph']) && !isset($thumbParams['ph'])) {
$thumbParams['ph'] = 300;
}
$thumb = Site::thumb($fullRelPath, $thumbParams);
if (!isset($params['caption'])) {
$file = new \GO\Base\Fs\File($fullRelPath);
$params['caption'] = $file->nameWithoutExtension();
}
if (!isset($params['alt'])) {
$params['alt'] = isset($params['caption']) ? $params['caption'] : basename($tag['params']['path']);
}
$html .= '<img src="' . $thumb . '" alt="' . $params['alt'] . '"';
$html .= 'class="thumb-img"';
$html .= ' />';
if (!isset($params['lightbox'])) {
$params['lightbox'] = "thumb";
}
if (!empty($params['lightbox'])) {
$a = '<a';
if (isset($params['caption'])) {
$a .= ' title="' . $params['caption'] . '"';
}
if (!isset($params['aclass'])) {
$params['aclass'] = 'thumb-a';
}
$a .= ' class="' . $params['aclass'] . '"';
if (isset($params['astyle'])) {
$a .= ' style="' . $params['astyle'] . '"';
}
$a .= ' data-lightbox="' . $params['lightbox'] . '" href="' . \Site::file($params['path'], false) . '">' . $html . '</a>';
// Create an url to the original image
$html = $a;
}
if (isset($params['caption'])) {
$html .= '<div class="thumb-caption">' . $params['caption'] . '</div>';
}
if (!isset($params['class'])) {
$params['class'] = 'thumb-wrap';
}
$wrap = '<div class="' . $params['class'] . '"';
if (isset($params['style'])) {
$wrap .= 'style="' . $params['style'] . '"';
}
$wrap .= '>';
$html = $wrap . $html . '</div>';
return $html;
}
示例4:
', '<?php
echo $domain;
?>
');
ga('send', 'pageview');
</script>
<?php
}
?>
<div class="container" id="header">
<div class="page-header">
<h1><img src="<?php
echo Site::file('images/groupoffice.gif');
?>
" alt="Group-Office" /> <small>manual for administrators</small></h1>
</div>
<?php
echo $content;
?>
<div id="footer">
Copyright Intermesh BV.<br /><a href="https://www.group-office.com">https://www.group-office.com</a>
</div>
</div>
示例5:
echo \Site::controller()->getPageTitle();
?>
</title>
<link rel="shortcut icon" type="image/x-icon" href="<?php
echo \Site::template()->getUrl();
?>
favicon.ico">
<link rel="stylesheet" href="<?php
echo \Site::template()->getUrl();
?>
css/site.css">
<?php
if (\Site::fileExists('style.css', false)) {
?>
<link rel="stylesheet" href="<?php
echo \Site::file('style.css', false);
?>
">
<?php
}
?>
</head>
<body>
<?php
echo $content;
?>
</body>
</html>