TYPO3 extension typoLink add class

If you are using typoLink when buildning your TYPO3 extension and you need to add a class just look at the example below.

The class parameter is the third parameter in the configuration array, the first value is page id, URL or email adress, the second value is target.
Example, if you want to link to page with id ”42” with target value ”_self”, it should look like this:

$this->cObj->typoLink("Title of link",array('parameter' => "42 _self YOUR_CLASS"));

Or if you prefer to use a variable to set your configuration:

$configuration = array('parameter' => "42 _self YOUR_CLASS");
$this->cObj->typoLink("Title of link",$configuration);

The output of the example above (both of them) will look like this:

<a href="index.php?id=42" target="_self" class="YOUR_CLASS">Title of link</a>

Lämna en kommentar