How can I use a PHP script in typo3 v9?

心已入冬 提交于 2020-03-24 09:45:05

问题


I'd like to know if there is a way to use a PHP script in the typo3 v9 or a newer version. If possible, I'd prefer a way to call a function and not to embed the code in an HTML box.

Thanks a lot


回答1:


A short history:

in earlier days (TYPO3 prior to 4.2) there was a PHP content element. As of the possibility to insert bad code it was removed.

then there was a possibilty to include any file with PHP code by typoscript as a userfunc.

That was restricted by TYPO3 6 as you now can only use methods of classes as userfunc.

For usage in the front end you can build a plugin, so the editor can use a function (with parameters) as desired. or include it by typoscript (userfunc) where you need it. This can be easily done with an extension (as bandanh commented), so your code is deployable and can be included in any installation.



来源:https://stackoverflow.com/questions/60304125/how-can-i-use-a-php-script-in-typo3-v9

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!