Get Smarty

Donate

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Buy cheap glasses from Cheapglasses123.com and save up to 80%.

Where to buy prescription glasses? EyewearCanada.com is your best choice!

Where to buy discount wedding dresses and cheap smart dresses free shipping - Weddingdresstrend.com

Shop for 2018 World Cup Football Boots Online sale at guthjcc.com

Browse best 2018 world cup soccer cleats and shoes from SoccerAzteca.com

Advertisement

Name

assignByRef() — 引用赋值

说明

void assignByRef(string varname,
                 mixed var);

assign() 一样,赋值到模板,但以引用的方式来传递值。

技术说明

在PHP5中,assignByRef()在大部分时候都是没有必要的。只当你希望在模板中可以修改某个PHP数组的值,才有可能会使用到assignByRef(),当然更好的方法是通过传递对象、改变对象的成员变量来达到目的。

Example 14.7. assignByRef()


<?php
// 传递键值对
$smarty->assignByRef('Name', $myname);
$smarty->assignByRef('Address', $address);
?>

   

参见 assign(), clearAllAssign(), append(), {assign}getTemplateVars().

Comments
No comments for this page.
Post a Comment
All comments are moderated. Support questions are ignored, use the forums instead.
Author:
Email: (not shown)
What is 19 plus 14? (Are you human?)

Advertisement