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}

 

版权声明:
作者:鲤小牛
链接:https://www.yunweiba.com/183.html
来源:运维吧
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>