pboootcms调用自定义标签并做数据处理
调用单行文本标签
<?php
use app\home\model\ParserModel;
this->modell = new ParserModel();labarr=this->modell->getLabel();
echolabarr['wapdomain']['value'];
?>
或者
{php}
arrstr=\core\basic\Db::table(ay_label)->field(value)->where("name='wapdomain'")->find();
echoarrstr->value;
{/php}
{php}{/php}和 <?php ?>意义一样
调用多行文本,逐行输出
{php}
footstr=\core\basic\Db::table(ay_label)->field(value)->where("name='foottxt'")->find();footarr=explode("<br>",footstr->value);
foreach(arrkey as v){
echo "v";
}
{/php}
调用多行文本,整块html输出
{php} arrstr=\core\basic\Db::table(ay_label)->field(value)->where("name='modnum'")->find();numstr=html_entity_decode(arrstr->value);numstr=str_replace("<br>","\r\n",numstr);
echonumstr;
{/php}
pbootcms自定义热门关键词标签单行文本
{php}
arrstr=\core\basic\Db::table('ay_label')->field('value')->where("name='hot_keywords'")->find();arrkey=explode("|",arrstr->value);
foreach(arrkey as v){
echo "<a href='/search/?keyword=".v."'>".$v."</a> ";
}
{/php}