Home  >  Article  >  Backend Development  >  模板赋值assign解决方法

模板赋值assign解决方法

WBOY
WBOYOriginal
2016-06-13 13:24:32820browse

模板赋值assign

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->$connect = mysql_connect('127.0.0.1', 'root', '123456');
mysql_select_db('456789', $connect);
mysql_query('set names gbk');
$sql = "select code from shop";
$query = mysql_query($sql);
$carts = array(
    'orders_id' => $cart->OrdersId,
    'cart_count' => $cart->cartCount(),
    'price_count' => $cart->priceCount()
);
$dtp = new DedeTemplate();
$dtp->Assign('carts',$carts);
$dtp->LoadTemplate(_PLUS_TPL_.'/car.htm');
$dtp->Display();
exit;


为何在模板car.htm中使用没能输出查询到的结果?

------解决方案--------------------
'price_count' => $cart->priceCount(), 后面是全角逗号。改为英文逗号即可。
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn