0

我可以在提交按钮上放置一个if 条件以将旧变量更新为新变量吗?我必须在我的 php 文件中声明它吗?如果您能告诉我您将使用哪种方法,我会很高兴。

假设我有一个分配的 var 并且代码将如下所示:

<!-- {assign var='featured' value=$featured} -->

我想更改或更新分配的变量和新的值,我应该使用什么方法以及如何将它存储在我的 php 文件中,以防它不能完全由 smarty 模板制作?

<!-- {if isset($newfeat) && $newfeat == 1}
{assign var='newfeatured' value=$newfeatured}{/if} --> I want this condition to be executed by pressing a submit button. I'm not much interested on the method and it can be .onclick do this condition above.
4

0 回答 0