「関数リファレンス/BcBaser isCurrentUrl」の版間の差分
提供: baserCMS公式ガイド
(ページの作成:「## 説明 指定したURLが現在のURLと同じかどうか判定する。 <比較例><br /> /news/ | /news/ ・・・○<br /> /news | /news/ ・・・×<br /> /news/...」) |
|||
(2人の利用者による、間の3版が非表示) | |||
行4: | 行4: | ||
<比較例><br /> | <比較例><br /> | ||
/news/ | /news/ ・・・○<br /> | /news/ | /news/ ・・・○<br /> | ||
− | /news | /news/ ・・・×<br /> | + | /news | /news/ ・・・×<br /> |
/news/ | /news/index ・・・○<br /> | /news/ | /news/index ・・・○<br /> | ||
行29: | 行29: | ||
####コード | ####コード | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
− | + | <?php $this->BcBaser->isCurrentUrl('/news/') ?> | |
</syntaxhighlight> | </syntaxhighlight> | ||
行52: | 行52: | ||
## 関連資料 | ## 関連資料 | ||
+ | [[Category:関数リファレンス]] |
2016年3月30日 (水) 11:58時点における最新版
目次
説明
指定したURLが現在のURLと同じかどうか判定する。
<比較例>
/news/ | /news/ ・・・○
/news | /news/ ・・・×
/news/ | /news/index ・・・○
使い方
$this->BcBaser->isCurrentUrl($url)
パラメータ
- (string) $url
- 比較対象URL
戻り値
(boolean) 同じ場合には true を返す
用例
基本
コード
<?php $this->BcBaser->isCurrentUrl('/news/') ?>