[Typo3-dev] TS inconsistencies...
René Fritz
r.fritz at colorcube.de
Thu Jul 24 13:23:56 CEST 2003
> I understand how gifbuilder works - what I mean is that the fontSize
> property of gifbuilder's text property, while accepting values from
> direct inputs (e.g. textSize = 12) and via the constants, doesn't seem
> to accept value from GPVar (e.g. textSize = GPVar:my_text_size, or
> textSize.data... etc).
Hi Dan
I also read your other mail where you suggest a more object orientated
approach of TS.
Even if it's not false what you suggest, it's not TS anymore. TS is not a
language, it's just a way to define parameters.
fontSize (Gifbuilder) is of type 'posint'. What means, the PHP function which
makes the text rendering expect an positive integer for that value. There's
no addition like you would like to see above.
What you meant with
fontSize = GPVar:my_text_size
is somthing like:
fontSize = GPVar("my_text_size")
This can't be done in TS. You can't get a value from a function (in that way)
in TS.
The benefit from all that limitations is that TS is easy to implement and it's
faster than a real language. But it's still a little more than just setting
up some parameters.
But that limitations are not a real problem because there IS a real language
available which can be used if TS won't fit: PHP
For your problem it means to write a small PHP script which go into an
extension to make it nice and clean :-)
In the script will be something like that:
$conf['fontSize'] = t3lib_div::GPvar('my_text_size');
$this->cObj->IMAGE($conf);
in TS:
page.10 = myIMAGE
page.10 {
// here can be used all IMAGE properties but font size will be set by the PHP
function
Ok. That's not really working, but it's the principle. You may have a look
into the randomImage extension which is an real example for that.
René
--
COLORCUBE
digital media lab
www.colorcube.de
More information about the TYPO3-dev
mailing list