TinyButStrong - the PHP Template Engine
Categories > TinyButStrong general >

using object methods with parameters in automatic fields

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs

By: lauren
Date: 2013-09-12
Time: 10:40

using object methods with parameters in automatic fields

hi and thanks for making this awesome tool

i'm using object methods in automatic fields, and i am passing in a parameter (such as "_header2" - a simple string)
i am putting it as [onshow.xlat.get_xlat("_header2")] in the automatic field and i discovered that the " are being passed in too
then i realized that this isn't actually code at all, rather just a text string being passed through to actual code, and the " are not needed even though my code looks really weird without them

is this correct?

thanks
:)
By: Skrol29
Date: 2013-09-14
Time: 23:03

Re: using object methods with parameters in automatic fields

Hi Lauren,

Yes it is totally right.

The documentation says:

When you are calling a method with arguments (like methY(a,b) in the example above), then TBS does a lazy analysis of arguments, without string delimiters. There is no intention to go further in the analysis because having PHP code in the template is not the purpose.