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>

Annonser

Kommentera

Fyll i dina uppgifter nedan eller klicka på en ikon för att logga in:

WordPress.com Logo

Du kommenterar med ditt WordPress.com-konto. Logga ut / Ändra )

Twitter-bild

Du kommenterar med ditt Twitter-konto. Logga ut / Ändra )

Facebook-foto

Du kommenterar med ditt Facebook-konto. Logga ut / Ändra )

Google+ photo

Du kommenterar med ditt Google+-konto. Logga ut / Ändra )

Ansluter till %s