[TYPO3-ect] ECT library

Ernesto Baschny [cron IT] ernst at cron-it.de
Thu Mar 9 12:15:03 CET 2006


Elmar Hinz schrieb am 09.03.2006 10:28:

> to open the game I have just uploaded the announced ECT link object.

Looks pretty cool!

> short usage:
> 
> $L = t3lib_div::makeInstance('ect_link');
> $L->label('My example Link');
> $L->page(23);
> $content .= $L->makeAnkerTag();

"Anker" is called "anchor" in english. But it might be more intuitive to
call it "getATag()", what do you think?

> $url = $L->makeUrl();

Looks nice. Maybe "getUrl()"?

> $L->label('My example Link');
> $L->titleAttribute('The link title');
> $L->classAttribute('myclass');
> $L->targetAttribute('_blank');
> $L->page('pagealias');

If this is related to TS-typolink "parameter", I would also call it
"parameter" as it might be misleading to have two different names for
the same thing. An external Url might not be a "page" and an
Email-Adress is definitively not a "page".

> $L->prefix('tx_example_extension');
> $L->parameters($this->piVars);    // keep piVars
> $L->overrule(array( 'var1' => 1, 'var2' => 22);
> 
> // gettings
> 
> $content .= $L->makeAnkerTag();
> $url = $L->makeUrl();
> 
> // destruct
> 
> unset($L);
> 
> How do you like it?

Nice start. I think I would be using that. I'm bored of having to use
TypoScript arrays to describe my links while doing a PHP-plugin.

In the constructor, you might want to pass a reference to a cObject,
instead of making a new one based on the passed class. As a Plugin I
already have a valid cObject which I could just pass to the ect_link
constructor.


Cheers,
Ernesto



More information about the TYPO3-team-extension-coordination mailing list