「ver4/関数リファレンス/BcBaser mark」の版間の差分
提供: baserCMS公式ガイド
細 (1版 : 関数リファレンス→ver4) |
Katokaisya (トーク | 投稿記録) |
||
(同じ利用者による、間の1版が非表示) | |||
行7: | 行7: | ||
## 使い方 | ## 使い方 | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
− | $this->BcBaser->mark($search, $text, | + | $this->BcBaser->mark($search, $text, $name , [$attributes], $escape ); |
</syntaxhighlight> | </syntaxhighlight> | ||
行19: | 行19: | ||
(string)$name | (string)$name | ||
: タグ名 | : タグ名 | ||
− | + | : 初期値:'strong' | |
− | + | ||
(array)$attributes | (array)$attributes | ||
: 属性 | : 属性 | ||
− | + | : 初期値:array() | |
− | + | ||
(boolean)$escape | (boolean)$escape | ||
: エスケープするかどうか | : エスケープするかどうか | ||
− | + | : 初期値:false | |
− | + | ||
## 戻り値 | ## 戻り値 |
2016年11月4日 (金) 22:45時点における最新版
[このコンテンツは内容調整中です]
目次
説明
文字列を検索しマークとしてタグをつけます。
使い方
$this->BcBaser->mark($search, $text, $name , [$attributes], $escape );
パラメータ
- (string)$search
- 検索する文字列
- (string)$text
- 検索対象の文字列
- (string)$name
- タグ名
- 初期値:'strong'
- (array)$attributes
- 属性
- 初期値:array()
- (boolean)$escape
- エスケープするかどうか
- 初期値:false
戻り値
- (string)$text
- 変換後文字列
用例
基本
コード
<?php $this->BcBaser->mark('強調', '強調します強調します強調します') ?>
取得
<strong>強調</strong>します<strong>強調</strong>します<strong>強調</strong>します