オプションリスト属性で複数の値を設定したとき、翻訳後の個々の値にタグ付けして出力したい
2019年1月9日 at 19:43
検索ブロックのカスタムテンプレートで表示を調整しているのですが、
オプションリスト属性で複数の値を設定したとき、
タグ付けした個々の値を’翻訳して’出力するにはどうすれば良いのでしょうか。
※値はインターフェース翻訳の設定をしています。
$document_category = $r->getAttribute('document_category');
<?php
if ($document_category) {
echo "<div class=\"document_category\">";
foreach($document_category as $dc) {
echo '<span>'. $dc .'</span>';
};
echo "</div>";
} ?>
レンタルサーバー
cpi ACE01
# concrete5 Version
Core Version - 8.4.2
Version Installed - 8.4.2
Database Version - 20180716000000
# Server Software
Apache
# PHP Version
7.0.32
タグ:
Your post has been saved and will be published after approval by the forum moderator.
leaps-nakagawa
Re: オプションリスト属性で複数の値を設定したとき、翻訳後の個々の値にタグ付けして出力したい
$document_category = $r->getAttribute('document_category', 'display');
$document_category = explode("<br/>" , $document_category);
array_pop($doc_category);