Smarty templating issue

At work I use Smarty for PHP templating, I would prefer to use Zend MVC but our Sever 2003 boxes don’t have url rewriting. End of rant. But I had an issue that was odd and just wanted to post the solution I found, I hope it helps someone. The issue was I was trying to fill a form in using data from a database so the user could edit the information. I was passing a database value and directly assigning it to a Smarty variable. Well the data would render as 0 (zero) when the page was output. There were no errors, just zeros. Well apparently Smarty did not like the hyphen in the word being returned from the database. So I changed the hyphens to underscores and all was well. Let me know if you run into this odd error.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s