English 中文(简体)
为什么我的延伸不能变成缩略语?
原标题:Why won t my extension render umlauts?

我正致力于在网站上显示下载内容的扩展。 您可以在< a href=> https://github.com/oliversalzburg/downloads> rel=“ no follown noreferrer”> on GitHub 上查看完整、 目前的源码。

根据我控制器 中的这个代码

  $linkName = Tx_Downloads_Utility_Filename::construct( $download );
  $download->setLinkText( $linkName );

这就是我要为下载设置标签的地方。 可悲的是, 如果 < code>$linkName 包含一个umlaut( umlauts was just my test subject, 实际范围未知), 稍后完成时结果将是空白 。

为了调试目的,我扩展了这一部分,使之看起来如此:

  $linkName = Tx_Downloads_Utility_Filename::construct( $download );
  $download->setLinkText( $linkName );
  $this->flashMessages->add( " " . strlen( $linkName ) . " " );
  $this->flashMessages->add( urlencode( $linkName ) );
  $this->flashMessages->add( $linkName );

The resulting output of that is: enter image description here Please note that no third flash message is rendered.


但它不像没有umlauts是不会被实现的。例如,这是我在调试的纪录:

""https://i.sstatic.net/kgfm9.png" alt="此处输入图像描述"/ >

链接字段( 在图像图标和31.06KB 之间) 是空白的, 但应该说 < code> Text_ File_ Sömething.jpg 。 字符串 < code> Sömething 在模板的另外一个地方完全可以使用 。

我的" Rel="无跟踪 nofollown noreferrer" >Fluid模板 有问题吗?

最佳回答

Sorry, that was not really clear. Next try: you call Tx_Downloads_Utility_Filename::construct($linkName) which (by default) calls Tx_Downloads_Utility_Filename::clean($linkName) which again removes all the special characters by replacing anything that doesn t match the regex pattern /([[:alnum:]_.-]*)/ by underscores. There seems to be a problem with encoding (maybe your db is not set to UTF-8 encoding) so Text_File_Sömething is actually turned into Text_File_Sömething and the clean() method turns that into an invalid string. try using utf8_encode() on the $filename first.

问题回答

暂无回答




相关问题
TYPO3 extensions and symlinks

Can I create a symlink to the local extension from aonther project folder? I have a common local-server and i need to implement same extension on all local project-installations. I tried to put the ...

TYPO3: Use TCA.php to build Frontend Forms?

I m searching for a solution, to build a frontend form from the TCA.php of my TYPO3 extension. Is there any way, to select TCA.php values, from my extension Class? I want to build a select-element ...

How to automatically reload TYPO3 calendar from external ics

Hi I m using the calendar base extension (cal) for displaying my calendar in a TYPO3 website. I configured an external calendar and it imports all events correctly. How can I automatically reload the ...

Does a svn frontend for git exist

We are planing to migrate our repositories from svn to git. However there are some people using np_subversion which integrates SVN into the TYPO3-Backend. np_subversion calls the svn client to make ...

wurfl2 integration in TYPO3

everytime i try to install the wurfl2 extension in TYPO3 i get the following error message: Fatal error: require_once() [function.require]: Failed opening required (include_path= .:/usr/local/php/...

TYPO3: getTypoLink_URL alternative (generating url aliases)

Is there an alternative way of getting the URL to a page (by id) apart from using cObj->getTypoLink_URL? I m trying to create URL aliases, so a page can have multiple URLs (for example "/about" ...

热门标签