個人用ツール

「ver4/関数リファレンス/BcBaser getThemeUrl」の版間の差分

提供: baserCMS公式ガイド

移動: 案内, 検索
(1版 : 関数リファレンス→ver4)
 
(同じ利用者による、間の1版が非表示)
行7: 行7:
 
## 使い方
 
## 使い方
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
$this->BcBaser->getThemeUrl();
+
<?php $this->BcBaser->getThemeUrl(); ?>
 
</syntaxhighlight>
 
</syntaxhighlight>
  
行18: 行18:
  
 
### 基本
 
### 基本
 
+
現在のテーマのURLを取得し、echoで出力する。
 
####コード
 
####コード
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
<img src="<?php echo $this->BcBaser->getThemeUrl() ?>img/logo.png" />
+
<?php echo $this->BcBaser->getThemeUrl(); ?>
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 +
####出力
 +
<syntaxhighlight lang="html5">
 +
/theme/bc_sample/
 +
</syntaxhighlight>
  
 
### 応用
 
### 応用
 
+
現在のテーマのURLを取得し、imgパスに利用する。
 
####コード
 
####コード
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
 
+
<img src="<?php echo $this->BcBaser->getThemeUrl() ?>img/logo.png">
 
</syntaxhighlight>
 
</syntaxhighlight>
 
  
 
####出力
 
####出力
 +
<syntaxhighlight lang="html5">
 +
<img src="/theme/bc_sample/img/logo.png">
 +
</syntaxhighlight>
  
##
+
## 類似の関数
 
+
- [themeUrl](/ver4/関数リファレンス/themeUrl) - テーマのURLを出力する
## 変更履歴
+
 
+
 
+
## ソースファイル
+
 
+
 
+
## 関連資料
+
[[Category:関数リファレンスver4]]
+

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を出力する