Smarty 传递的参数

Smarty都能传递什么参数

普通变量  string bool int

数组  array

常量  define、const定义的

系统常量  等等

 

 Smarty接收常量在php IMG_DIR定义的

<img src="{$smarty.const.IMG_DIR}/logo.png" class="radius" alt="后台管理系统" /></a>

 

Smarty全局变量接收

    <!-- 接收GET传递的参数id -->
    {$smarty.get.id}    

php 页面中传递值,smarty在html中能接收到

http://localhost/Smartry/controller.php?id=33

常量

    {$smarty.const.CC}
<?php 
include './Vendor/Smarty.class.php';
$smart=new Smarty();
define("CC","中国制造");

$smart->display('my.html');

 session

<?php

$_SESSION['admin']="duwei";
<!--接收php传递的值-->

{$smarty.session.admin}

 

posted @ 2021-02-01 12:26  WhiteSpace  阅读(185)  评论(0)    收藏  举报