Re: [SMARTY] Having problem with assignement when space are in the string
| From: | Mark Rogers | Date: | Wed, 18 Sep 2002 16:52:11 +0000 |
| Subject: | Re: [SMARTY] Having problem with assignement when space are in the string | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-5994@lists.php.net to get a copy of this message | ||
> Like $smary->assign("VAR","hello everybody");
>
> Smarty cut my string just before the space
>
> I really cannot understand why it's doing that, bu I'm sure that the
> string is cut in the assign.
This seems very unlikely; it seems far more likely (to me) that the problem
is in the template.
If you are viewing your page in a browser (likely) then use the View Source
facility to confirm that the actual text is not in the HTML source.
For example, if you had:
$smarty->assign("default", "Hello Everybody");
and (in the template)
<INPUT type=TEXT name=Test value={$default}>
.. then you'd see
<INPUT type=TEXT name=Test value=Hello Everybody>
.. in the source, but the input box would only show the Hello when displayed
in the browser due to the space inside the INPUT tag.
(If this is the problem then the template should instead say:
<INPUT type=TEXT name=Test value="{$default}">
.. but this is just an example).
If in doubt put:
{$VAR}
.. near the top of your template - ie somewhere you can find it - and view
the source to see whether it is getting that far.
Failing that post a (small) example of both the $smarty->assign() code and
template you are using here.
Mark Rogers
Quarella Ltd