0

我正在尝试做到这一点:

$productlist= $tpl->draw( 'products' );

稍后我想在其他文件上回显它:

而 $tpl->draw( 'products' ) 例如显示一些输出

<div id="productlist>
include("products");
</div>
4

2 回答 2

0

尝试这个

$productlist= $tpl->draw( 'products' );

//类文件

class drawing{

  function draw($type) {

  $str='';

   if($type=='')
    $type='default'

    $ids=$type.'list';

    $str="<div id='$ids'> include('$type') </div>";
    return $str;
 }
}
于 2012-06-06T04:27:13.703 回答
0

您可以通过使用会话变量或从数据库或平面文件中存储和检索来将数据公开给另一个脚本。

于 2012-06-06T04:07:27.217 回答