Add anchor in getTypoLink

getTypoLink() doesn't allow you to pass an anchor parameter. So, in order to add an anchor to such a link you just have to add the anchor part to the id parameter:

$this->cObj->getTypoLink('Link Label', '123#myanchor');

$this->cObj->pi_linkToPage('Link Label', '123#myanchor');

$this->cObj->getTypoLink_URL('123#myanchor');

By the way, ever saw what the harmless function class.tslib_content.php:typoLink() does? Have a look just for fun, it's a 300 liner! Feels like Typo3 has a damned considerable amount of workarounds for various special cases and requirements.