Kornel Lesiński <kor...@...> writes:
> > Could you explain to me, why I should write and use a custom  
> > phptal_tale()function, when I could do the same by just calling PHP
> > directly (php: myFunction(value))?
> Sure, you can use php: expressions if that suits you.
> Expression modifiers are syntactic sugar and allow you to use  
> shorter/nicer expressions in templates. They can have their own  
> special-purpose syntax (you can preprocess/split the expression before  
> passing it on to phptal_tales()).
> > I don't understand/see an advantage, when I just call a phptal_tales()  
> > function, which seems to be just a wrapper...
> phptal_tales() is TALES to PHP compiler.
> This is another benefit, because with php: modifier you need to use a bit  
> awkward type-dependent syntax (e.g. foo[bar].baz), but with if you use  
> phptal_tales(), your expression modifier may accept simpler "foo/bar/baz"  
> syntax.

Thank you.

With the phptal_tale() function (note the missing "s") I can achieve to write 
little phptal functions, which will act as wrappers for my PHP functions. This 
will really ends in a much more readable template and I can use the fancy array 
syntax like Array/key/Key...


PHPTAL mailing list

Reply via email to