「ver4/関数リファレンス/BcBaser getThemeUrl」の版間の差分
提供: baserCMS公式ガイド
行21: | 行21: | ||
####コード | ####コード | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
− | <?php echo $this->BcBaser->getThemeUrl() ?> | + | <?php echo $this->BcBaser->getThemeUrl(); ?> |
</syntaxhighlight> | </syntaxhighlight> | ||
行33: | 行33: | ||
####コード | ####コード | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
− | <img src="<?php echo $this->BcBaser->getThemeUrl() ?>img/logo.png" | + | <img src="<?php echo $this->BcBaser->getThemeUrl() ?>img/logo.png"> |
</syntaxhighlight> | </syntaxhighlight> | ||
####出力 | ####出力 | ||
<syntaxhighlight lang="html5"> | <syntaxhighlight lang="html5"> | ||
− | /theme/bc_sample/ | + | <img src="/theme/bc_sample/img/logo.png"> |
</syntaxhighlight> | </syntaxhighlight> | ||
− | ## | + | ## 類似の関数 |
− | + | - [themeUrl](/ver4/関数リファレンス/themeUrl) - テーマのURLを出力する | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | [ | + |
2019年1月17日 (木) 23:50時点における最新版
[このコンテンツは内容調整中です]
説明
現在のテーマのURLを取得する。
使い方
<?php $this->BcBaser->getThemeUrl(); ?>
戻り値
- (string)
- テーマURL
用例
基本
現在のテーマのURLを取得し、echoで出力する。
コード
<?php echo $this->BcBaser->getThemeUrl(); ?>
出力
/theme/bc_sample/
応用
現在のテーマのURLを取得し、imgパスに利用する。
コード
<img src="<?php echo $this->BcBaser->getThemeUrl() ?>img/logo.png">
出力
<img src="/theme/bc_sample/img/logo.png">
類似の関数
- themeUrl - テーマのURLを出力する