V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Lucius
V2EX  ›  问与答

smarty中 {$smarty.cookies.cookie} 怎么传递变量参数呢?

  •  
  •   Lucius · Jan 4, 2014 · 2348 views
    This topic created in 4499 days ago, the information mentioned may be changed or developed.
    {$smarty.cookies.cookie} 这样是可以的 但是

    {$cookie|cat:'cookie' } {$smarty.cookies.$cookie} dosen't work :(
    Supplement 1  ·  Jan 4, 2014
    解决了 使用

    {assign var="cookie" value=$cookie} 声明模板变量

    再用

    {php}
    $cookiename = $this->get_template_vars('cookie');
    echo $_COOKIE[$cookie];
    {/php}

    获取到cookie 不知有没有更好的办法
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2518 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 03:49 · PVG 11:49 · LAX 20:49 · JFK 23:49
    ♥ Do have faith in what you're doing.