オプションリスト属性で複数の値を設定したとき、翻訳後の個々の値にタグ付けして出力したい

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

タグ:

Re: オプションリスト属性で複数の値を設定したとき、翻訳後の個々の値にタグ付けして出力したい

2019年1月11日 at 11:56
無理あると思いますが、これでやり過ごしました。
$document_category = $r->getAttribute('document_category', 'display');
$document_category = explode("<br/>" , $document_category);
array_pop($doc_category);