-1

I'm working on a old project and I don't want to use Smarty anymore so i need to convert some code back to normal again. I tried a couple of times with no luck so if someone could help me i would be very happy.

Here is the Smarty template file: http://tny.cz/ca234392

Here is the file mixed with smarty: http://tny.cz/d4256f07

The project is using the mysql_ library but I don't want to use that any more, I will replace it with PDO ;)

4

1 回答 1

1

smarty 代码应该很容易理解。

您应该能够用简单的 PHP 替换模板中的 smarty 部分,如下所示:

{if $error ne ""}
<div class="short_error">{$error}</div>
{/if}

变成

<?php if($error != "") { ?>
<div class="short_error"><?php echo $error?></div>
<?php } ?>

完成后,只需将新模板文件包含在 smarty 调用的位置即可。

于 2013-06-13T21:52:04.590 回答