Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Search found 13 matches
Smarty Forum Index
Author Message
  Topic: syntax {$foo->function('string'.$var)}
robert

Replies: 4
Views: 6368

PostForum: Smarty 3   Posted: Mon Oct 26, 2009 5:53 pm   Subject: syntax {$foo->function('string'.$var)}
Thanks!
  Topic: syntax {$foo->function('string'.$var)}
robert

Replies: 4
Views: 6368

PostForum: Smarty 3   Posted: Mon Oct 26, 2009 3:18 pm   Subject: syntax {$foo->function('string'.$var)}
Hi

I tried it out and & evaluates to logical AND.

The result is thus:
$_smarty_tpl->getVariable('foo')->value->function('string' & $_smarty_tpl->getVariable( ...
  Topic: syntax {$foo->function('string'.$var)}
robert

Replies: 4
Views: 6368

PostForum: Smarty 3   Posted: Mon Oct 26, 2009 4:13 am   Subject: syntax {$foo->function('string'.$var)}
Hi

I'm calling a function on an object from smarty, and the argument is composed of a concatenated string like so:
{$foo->function('string'.$var)}

This, however doesn't seem to be supported. ...
  Topic: Smarty and <?xml
robert

Replies: 16
Views: 23614

PostForum: Smarty 3   Posted: Wed Mar 04, 2009 8:04 pm   Subject: Smarty and <?xml
Sorry to have to open this up again, maybe this should go in a new thread but I found a new error related to the <?xml declaration.

This time its related to the cache functionality, namely the e ...
  Topic: Smarty and <?xml
robert

Replies: 16
Views: 23614

PostForum: Smarty 3   Posted: Wed Mar 04, 2009 5:42 pm   Subject: Smarty and <?xml
Ah, I see.

Thanks for the fast reply, and I hope next time I might be able to help out a bit more and supply a patch or two
  Topic: Smarty and <?xml
robert

Replies: 16
Views: 23614

PostForum: Smarty 3   Posted: Wed Mar 04, 2009 5:15 pm   Subject: Smarty and <?xml
The newline should instead be after the XML statement.
This would be correct in this case:
?php echo '<?xml';?> version="1.0" encoding="UTF-8"<?php echo '?>
';?> ...
  Topic: Smarty and <?xml
robert

Replies: 16
Views: 23614

PostForum: Smarty 3   Posted: Wed Mar 04, 2009 5:11 pm   Subject: Smarty and <?xml
I think you got it this time, it gives me the correct output.

Theres only one difference now when having the xml declaration inside a if statement, and that is that it forces a newline before the x ...
  Topic: Smarty and <?xml
robert

Replies: 16
Views: 23614

PostForum: Smarty 3   Posted: Wed Mar 04, 2009 4:36 pm   Subject: Smarty and <?xml
After some more exhaustive testing I came to the conclusion that this problem does not occur unless the <?xml statement in enclosed by a if-statement.

So, just having a template with the followi ...
  Topic: Smarty and <?xml
robert

Replies: 16
Views: 23614

PostForum: Smarty 3   Posted: Wed Mar 04, 2009 4:18 pm   Subject: Smarty and <?xml
Updated repository and tried again, but this time theres no change at all.
Still same output as last time.
  Topic: Smarty and <?xml
robert

Replies: 16
Views: 23614

PostForum: Smarty 3   Posted: Wed Mar 04, 2009 4:00 pm   Subject: Smarty and <?xml
The fix only does half the work, after the fix it now outputs:
<?xml version="1.0" encoding="UTF-8"<?php echo '?>';?>

Since the beginning of the XML tag isn't escap ...
  Topic: Comments and literal
robert

Replies: 1
Views: 5077

PostForum: Smarty 3   Posted: Wed Mar 04, 2009 3:55 pm   Subject: Comments and literal
Alright, heres another one...

Smarty seems to have a problem commenting out literals.
A template like:
{* {literal} *}
Produces the error:
Unexpected "{literal ...
  Topic: Smarty and <?xml
robert

Replies: 16
Views: 23614

PostForum: Smarty 3   Posted: Wed Mar 04, 2009 3:26 pm   Subject: Smarty and <?xml
Nothing wrong with that, but thats not what i get.
Let me show you the output of the template file as an illustration.

This is the output smarty gives me:
<?php /* Smarty version Smarty3Alpha, ...
  Topic: Smarty and <?xml
robert

Replies: 16
Views: 23614

PostForum: Smarty 3   Posted: Wed Mar 04, 2009 2:54 pm   Subject: Smarty and <?xml
I just gave Smarty3 (r3014) a spin and noticed a few inconsistencies with Smarty 2.

A statement like this is just passes through the Smarty 3 parser
<?xml version="1.0" encoding=" ...
 
Page 1 of 1
All times are GMT
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP