本文整理汇总了PHP中source\libs\Resource::getThemePath方法的典型用法代码示例。如果您正苦于以下问题:PHP Resource::getThemePath方法的具体用法?PHP Resource::getThemePath怎么用?PHP Resource::getThemePath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类source\libs\Resource
的用法示例。
在下文中一共展示了Resource::getThemePath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: beginLoopData
public function beginLoopData($dataSource, $item, $appendOptions = [])
{
$options = [];
$options['dataSource'] = $dataSource;
$options['item'] = Resource::getThemePath($item);
return LoopData::begin($options);
}
示例2:
</div>
</div>
</div>
<div id="comment-ad" class="banner banner-related">
</div>
<a name="comments"></a>
<div class="ds-thread" data-thread-key="3975" data-author-key="1" data-title="" data-url=""></div>
</div>
</div>
<aside class="sidebar">
<?php
echo $this->render(Resource::getThemePath('/views/_inc/takonomy'), ['takonomyId' => 'page_takonomy']);
?>
<div class="widget d_postlist">
<div class="title">
<h2>为您推荐</h2>
</div>
<ul>
<?php
$datas = $this->getDataSource(null, null, 5, ['is_pic' => true]);
$this->loopData($datas, '/views/_inc/item_pic');
?>
</ul>
</div>
<div class="widget d_postlist">
<div class="title">
<h2>热评文章</h2>
示例3:
?>
<li><?php
echo Html::a($takonomy['name'], ['/post/default/list', 'takonomy' => $takonomy['id']]);
?>
</li>
<?php
}
?>
</ul>
</div>
<div class="widget d_postlist">
<div class="title"><h2>热评文章</h2></div>
<ul>
<?php
echo $this->render(Resource::getThemePath('/views/_inc/post_list_widget'), ['orderBy' => 'comment_count desc', 'limit' => 3]);
?>
</ul>
</div>
<div class="widget ds-widget-recent-visitors">
<div class="title"><h2>最近访客</h2></div>
<ul class="ds-recent-visitors" data-num-items="15" data-show-time="0" data-avatar-size="50">
</ul>
</div>
<script>
if (typeof DUOSHUO !== 'undefined')
DUOSHUO.RecentVisitors('.ds-recent-visitors');
</script>
</aside>
示例4:
</ul>
</div>
<div class="widget d_postlist">
<div class="title"><h2>为您推荐</h2></div>
<ul>
<?php
echo $this->render(Resource::getThemePath('/views/_inc/content_list'), ['orderBy' => 'created_at desc']);
?>
</ul>
</div>
<div class="widget d_postlist">
<div class="title"><h2>热评文章</h2></div>
<ul>
<?php
echo $this->render(Resource::getThemePath('/views/_inc/content_list'), ['orderBy' => 'created_at desc']);
?>
</ul>
</div>
<div class="widget ds-widget-recent-visitors">
<div class="title"><h2>最近访客</h2></div>
<ul class="ds-recent-visitors" data-num-items="15" data-show-time="0" data-avatar-size="50">
</ul>
</div>
<script>
if (typeof DUOSHUO !== 'undefined')
DUOSHUO.RecentVisitors('.ds-recent-visitors');
</script>
</aside>
示例5:
use source\LuLu;
/* @var $this yii\web\View */
if (!isset($orderBy)) {
$orderBy = 'created_at desc';
}
if (!isset($limit)) {
$limit = 5;
}
if (!isset($item)) {
$item = 'item_pic';
}
$where = [];
if (!isset($isPic)) {
$isPic = true;
}
$moduleId = LuLu::$app->controller->module->id;
if ($moduleId !== 'app-frontend') {
$where = ['content_type' => $moduleId];
}
$query = Content::findQuery($where, $orderBy);
if ($isPic) {
$query->andWhere(['!=', 'thumb', '']);
}
$query->limit($limit);
$contents = $query->all();
?>
<?php
foreach ($contents as $content) {
echo $this->render(Resource::getThemePath('/views/_inc/' . $item), ['content' => $content]);
}