最新
版块
发主题
搜索
我的

怎么引入php文件?

bysun 2023-7-11 3225

我是mac改的sea模板

php内容为

<?php

function unicode_encode($strLong) {

   $strArr = unicode_split($strLong); 

   $resUnicode = '';

   foreach ($strArr as $str)

   {

      $str = '&#' . base_convert(bin2hex(iconv("utf-8", "ucs-4", $str)), 16, 10) . ';';  

      $resUnicode .= $str;

   }

   return $resUnicode;

 }

 function unicode_split($str) {

   $strLong = '';

   if($strLong !== $str){

      $strLong =  preg_split('/(?<!^)(?!$)/u', $str);

   }  

   return $strLong;

 }


调用方式为

{php}require MAC_ROOT_TEMPLATE . 'php/function.php'{/php}

{:mac_url_type($vo2)}">{:unicode_encode('更多')}

标签是{$obj.vod_name|unicode_encode}这样调用的

要怎么改能适应sea啊?


最后于 2023-7-11 被bysun编辑 ,原因:
最新回复 (1)
  • 海洋 2023-7-12
    0 引用 2
    为了安全,海洋cms的模板引擎不支持调用php代码。
    具体模板标签文档和使用办法,请查看技术文档
返回